]> git.lyx.org Git - features.git/blobdiff - boost/boost/type_traits/is_virtual_base_of.hpp
boost: add eol property
[features.git] / boost / boost / type_traits / is_virtual_base_of.hpp
index 006e1c6e296969c96dac6caddd9058b5036596a8..30b34f6ccbde239d27e181c593098fe4c97da08f 100644 (file)
-//  (C) Copyright Daniel Frey and Robert Ramey 2009.\r
-//  Use, modification and distribution are subject to the Boost Software License,\r
-//  Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at\r
-//  http://www.boost.org/LICENSE_1_0.txt).\r
-//\r
-//  See http://www.boost.org/libs/type_traits for most recent version including documentation.\r
\r
-#ifndef BOOST_TT_IS_VIRTUAL_BASE_OF_HPP_INCLUDED\r
-#define BOOST_TT_IS_VIRTUAL_BASE_OF_HPP_INCLUDED\r
-\r
-#include <boost/type_traits/is_base_of.hpp>\r
-#include <boost/type_traits/is_same.hpp>\r
-#include <boost/mpl/and.hpp>\r
-#include <boost/mpl/not.hpp>\r
-\r
-// should be the last #include\r
-#include <boost/type_traits/detail/bool_trait_def.hpp>\r
-\r
-namespace boost {\r
-namespace detail {\r
-\r
-\r
-#ifdef BOOST_MSVC\r
-#pragma warning( push )\r
-#pragma warning( disable : 4584 )\r
-#elif defined __GNUC__\r
-#pragma GCC system_header\r
-#endif\r
-\r
-template<typename Base, typename Derived, typename tag>\r
-struct is_virtual_base_of_impl\r
-{\r
-    BOOST_STATIC_CONSTANT(bool, value = false);\r
-};\r
-\r
-template<typename Base, typename Derived>\r
-struct is_virtual_base_of_impl<Base, Derived, mpl::true_>\r
-{\r
-#ifdef __BORLANDC__\r
-    struct X : public virtual Derived, public virtual Base \r
-    {\r
-       X();\r
-       X(const X&);\r
-       X& operator=(const X&);\r
-       ~X()throw();\r
-    };\r
-    struct Y : public virtual Derived \r
-    {\r
-       Y();\r
-       Y(const Y&);\r
-       Y& operator=(const Y&);\r
-       ~Y()throw();\r
-    };\r
-#else\r
-    struct X : Derived, virtual Base \r
-    {\r
-       X();\r
-       X(const X&);\r
-       X& operator=(const X&);\r
-       ~X()throw();\r
-    };\r
-    struct Y : Derived \r
-    {\r
-       Y();\r
-       Y(const Y&);\r
-       Y& operator=(const Y&);\r
-       ~Y()throw();\r
-    };\r
-#endif\r
-    BOOST_STATIC_CONSTANT(bool, value = (sizeof(X)==sizeof(Y)));\r
-};\r
-\r
-template<typename Base, typename Derived>\r
-struct is_virtual_base_of_impl2\r
-{\r
-   typedef typename mpl::and_<is_base_of<Base, Derived>, mpl::not_<is_same<Base, Derived> > >::type tag_type;\r
-   typedef is_virtual_base_of_impl<Base, Derived, tag_type> imp;\r
-   BOOST_STATIC_CONSTANT(bool, value = imp::value);\r
-};\r
-\r
-#ifdef BOOST_MSVC\r
-#pragma warning( pop )\r
-#endif\r
-\r
-} // namespace detail\r
-\r
-BOOST_TT_AUX_BOOL_TRAIT_DEF2(\r
-      is_virtual_base_of\r
-       , Base\r
-       , Derived\r
-       , (::boost::detail::is_virtual_base_of_impl2<Base,Derived>::value) \r
-)\r
-\r
-#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION\r
-BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC2_2(typename Base,typename Derived,is_virtual_base_of,Base&,Derived,false)\r
-BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC2_2(typename Base,typename Derived,is_virtual_base_of,Base,Derived&,false)\r
-BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC2_2(typename Base,typename Derived,is_virtual_base_of,Base&,Derived&,false)\r
-#endif\r
-\r
-} // namespace boost\r
-\r
-#include <boost/type_traits/detail/bool_trait_undef.hpp>\r
-\r
-#endif\r
+//  (C) Copyright Daniel Frey and Robert Ramey 2009.
+//  Use, modification and distribution are subject to the Boost Software License,
+//  Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+//  http://www.boost.org/LICENSE_1_0.txt).
+//
+//  See http://www.boost.org/libs/type_traits for most recent version including documentation.
+#ifndef BOOST_TT_IS_VIRTUAL_BASE_OF_HPP_INCLUDED
+#define BOOST_TT_IS_VIRTUAL_BASE_OF_HPP_INCLUDED
+
+#include <boost/type_traits/is_base_of.hpp>
+#include <boost/type_traits/is_same.hpp>
+#include <boost/mpl/and.hpp>
+#include <boost/mpl/not.hpp>
+
+// should be the last #include
+#include <boost/type_traits/detail/bool_trait_def.hpp>
+
+namespace boost {
+namespace detail {
+
+
+#ifdef BOOST_MSVC
+#pragma warning( push )
+#pragma warning( disable : 4584 )
+#elif defined __GNUC__
+#pragma GCC system_header
+#endif
+
+template<typename Base, typename Derived, typename tag>
+struct is_virtual_base_of_impl
+{
+    BOOST_STATIC_CONSTANT(bool, value = false);
+};
+
+template<typename Base, typename Derived>
+struct is_virtual_base_of_impl<Base, Derived, mpl::true_>
+{
+#ifdef __BORLANDC__
+    struct X : public virtual Derived, public virtual Base 
+    {
+       X();
+       X(const X&);
+       X& operator=(const X&);
+       ~X()throw();
+    };
+    struct Y : public virtual Derived 
+    {
+       Y();
+       Y(const Y&);
+       Y& operator=(const Y&);
+       ~Y()throw();
+    };
+#else
+    struct X : Derived, virtual Base 
+    {
+       X();
+       X(const X&);
+       X& operator=(const X&);
+       ~X()throw();
+    };
+    struct Y : Derived 
+    {
+       Y();
+       Y(const Y&);
+       Y& operator=(const Y&);
+       ~Y()throw();
+    };
+#endif
+    BOOST_STATIC_CONSTANT(bool, value = (sizeof(X)==sizeof(Y)));
+};
+
+template<typename Base, typename Derived>
+struct is_virtual_base_of_impl2
+{
+   typedef typename mpl::and_<is_base_of<Base, Derived>, mpl::not_<is_same<Base, Derived> > >::type tag_type;
+   typedef is_virtual_base_of_impl<Base, Derived, tag_type> imp;
+   BOOST_STATIC_CONSTANT(bool, value = imp::value);
+};
+
+#ifdef BOOST_MSVC
+#pragma warning( pop )
+#endif
+
+} // namespace detail
+
+BOOST_TT_AUX_BOOL_TRAIT_DEF2(
+      is_virtual_base_of
+       , Base
+       , Derived
+       , (::boost::detail::is_virtual_base_of_impl2<Base,Derived>::value) 
+)
+
+#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC2_2(typename Base,typename Derived,is_virtual_base_of,Base&,Derived,false)
+BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC2_2(typename Base,typename Derived,is_virtual_base_of,Base,Derived&,false)
+BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC2_2(typename Base,typename Derived,is_virtual_base_of,Base&,Derived&,false)
+#endif
+
+} // namespace boost
+
+#include <boost/type_traits/detail/bool_trait_undef.hpp>
+
+#endif