]> git.lyx.org Git - lyx.git/blobdiff - boost/boost/detail/compressed_pair.hpp
Fixed some lines that were too long. It compiled afterwards.
[lyx.git] / boost / boost / detail / compressed_pair.hpp
index c45d20c599dc2c5207a2aa333974534bed6fa548..3f326456ce7c2ba981c209c74394a9d2ed024f00 100644 (file)
 #include <boost/type_traits/is_same.hpp>
 #include <boost/call_traits.hpp>
 
+#ifdef BOOST_MSVC
+# pragma warning(push)
+# pragma warning(disable:4512)
+#endif 
 namespace boost
 {
 
@@ -132,7 +136,7 @@ namespace details
 
    template <class T1, class T2>
    class compressed_pair_imp<T1, T2, 1>
-      : private ::boost::remove_cv<T1>::type
+      : protected ::boost::remove_cv<T1>::type
    {
    public:
       typedef T1                                                 first_type;
@@ -174,7 +178,7 @@ namespace details
 
    template <class T1, class T2>
    class compressed_pair_imp<T1, T2, 2>
-      : private ::boost::remove_cv<T2>::type
+      : protected ::boost::remove_cv<T2>::type
    {
    public:
       typedef T1                                                 first_type;
@@ -217,8 +221,8 @@ namespace details
 
    template <class T1, class T2>
    class compressed_pair_imp<T1, T2, 3>
-      : private ::boost::remove_cv<T1>::type,
-        private ::boost::remove_cv<T2>::type
+      : protected ::boost::remove_cv<T1>::type,
+        protected ::boost::remove_cv<T2>::type
    {
    public:
       typedef T1                                                 first_type;
@@ -253,11 +257,14 @@ namespace details
 
    // JM
    // 4    T1 == T2, T1 and T2 both empty
-   //      Note does not actually store an instance of T2 at all -
-   //      but reuses T1 base class for both first() and second().
+   //      Originally this did not store an instance of T2 at all
+   //      but that led to problems beause it meant &x.first() == &x.second()
+   //      which is not true for any other kind of pair, so now we store an instance
+   //      of T2 just in case the user is relying on first() and second() returning
+   //      different objects (albeit both empty).
    template <class T1, class T2>
    class compressed_pair_imp<T1, T2, 4>
-      : private ::boost::remove_cv<T1>::type
+      : protected ::boost::remove_cv<T1>::type
    {
    public:
       typedef T1                                                 first_type;
@@ -428,5 +435,9 @@ swap(compressed_pair<T1, T2>& x, compressed_pair<T1, T2>& y)
 
 } // boost
 
+#ifdef BOOST_MSVC
+# pragma warning(pop)
+#endif 
+
 #endif // BOOST_DETAIL_COMPRESSED_PAIR_HPP