]> git.lyx.org Git - lyx.git/blobdiff - 3rdparty/boost/boost/parameter/aux_/is_maybe.hpp
Update to boost 1.72
[lyx.git] / 3rdparty / boost / boost / parameter / aux_ / is_maybe.hpp
index b8758528476f9f034d92bf74b4c2730ae35915d6..0069eddc14e5096fa13feebdc4ed73a970ced9dd 100644 (file)
@@ -1,26 +1,52 @@
-// Copyright Daniel Wallin, David Abrahams 2010. Use, modification and
-// distribution is subject to the Boost Software License, Version 1.0. (See
-// accompanying file LICENSE_1_0.txt or copy at
+// Copyright Daniel Wallin, David Abrahams 2010.
+// Distributed under 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)
 
 #ifndef BOOST_PARAMETER_IS_MAYBE_050329_HPP
 #define BOOST_PARAMETER_IS_MAYBE_050329_HPP
 
-#include <boost/type_traits/is_base_and_derived.hpp>
+namespace boost { namespace parameter { namespace aux {
 
-namespace boost {
-namespace parameter {
-namespace aux {
+    struct maybe_base
+    {
+    };
+}}} // namespace boost::parameter::aux
 
-struct maybe_base {};
+#if defined(BOOST_PARAMETER_CAN_USE_MP11)
+#include <type_traits>
 
-template <class T>
-struct is_maybe
-  : is_base_and_derived<maybe_base, T>
-{};
+namespace boost { namespace parameter { namespace aux {
 
-} // namespace aux
-} // namespace parameter
-} // namespace boost
+    template <typename T>
+    using is_maybe = ::std::is_base_of<
+        ::boost::parameter::aux::maybe_base
+      , typename ::std::remove_const<T>::type
+    >;
+}}} // namespace boost::parameter::aux
+
+#else   // !defined(BOOST_PARAMETER_CAN_USE_MP11)
+#include <boost/mpl/bool.hpp>
+#include <boost/mpl/if.hpp>
+#include <boost/type_traits/is_base_of.hpp>
+#include <boost/type_traits/remove_const.hpp>
+
+namespace boost { namespace parameter { namespace aux {
+
+    template <typename T>
+    struct is_maybe
+      : ::boost::mpl::if_<
+            ::boost::is_base_of<
+                ::boost::parameter::aux::maybe_base
+              , typename ::boost::remove_const<T>::type
+            >
+          , ::boost::mpl::true_
+          , ::boost::mpl::false_
+        >::type
+    {
+    };
+}}} // namespace boost::parameter::aux
+
+#endif  // BOOST_PARAMETER_CAN_USE_MP11
+#endif  // include guard
 
-#endif // BOOST_PARAMETER_IS_MAYBE_050329_HPP