]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/boost/boost/parameter/aux_/set.hpp
import new upstream nautilus stable release 14.2.8
[ceph.git] / ceph / src / boost / boost / parameter / aux_ / set.hpp
index 7ab93dc7bb57b5ecc284b989e08d5274e7379b35..418b0b174d075b71eb544fbd3bf5f60649bf2db2 100644 (file)
-// Copyright Daniel Wallin 2006. Use, modification and distribution is
-// 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)
+// Copyright Daniel Wallin 2006.
+// 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_SET_060912_HPP
-# define BOOST_PARAMETER_SET_060912_HPP
+#define BOOST_PARAMETER_SET_060912_HPP
 
-# include <boost/detail/workaround.hpp>
+#include <boost/parameter/config.hpp>
 
-# if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
-#  include <boost/mpl/insert.hpp>
-#  include <boost/mpl/set/set0.hpp>
-#  include <boost/mpl/has_key.hpp>
+#if defined(BOOST_PARAMETER_CAN_USE_MP11)
+#include <boost/mp11/list.hpp>
 
 namespace boost { namespace parameter { namespace aux {
 
-typedef mpl::set0<> set0;
+    typedef ::boost::mp11::mp_list<> set0;
+}}} // namespace boost::parameter::aux
+
+#include <boost/mp11/algorithm.hpp>
+
+namespace boost { namespace parameter { namespace aux {
+
+    template <typename S, typename K>
+    struct insert_
+    {
+        using type = ::boost::mp11::mp_insert_c<S,0,K>;
+    };
+}}} // namespace boost::parameter::aux
+
+#include <boost/mp11/integral.hpp>
+#include <boost/mp11/utility.hpp>
+#include <type_traits>
+
+namespace boost { namespace parameter { namespace aux {
+
+    template <typename Set, typename K>
+    struct has_key_
+    {
+        using type = ::boost::mp11::mp_if<
+            ::boost::mp11::mp_empty<Set>
+          , ::boost::mp11::mp_false
+          , ::std::is_same<
+                ::boost::mp11::mp_find<Set,K>
+              , ::boost::mp11::mp_size<Set>
+            >
+        >;
+    };
+}}} // namespace boost::parameter::aux
+
+#elif BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
+#include <boost/mpl/list.hpp>
+
+namespace boost { namespace parameter { namespace aux {
+
+    typedef ::boost::mpl::list0<> set0;
+}}} // namespace boost::parameter::aux
 
-template <class Set, class K>
-struct insert_
-{
-    typedef typename mpl::insert<Set, K>::type type;
-};
+#include <boost/mpl/push_front.hpp>
 
-template <class Set, class K>
-struct has_key_
-{
-    typedef typename mpl::has_key<Set, K>::type type;
-};
+namespace boost { namespace parameter { namespace aux {
 
+    template <typename Set, typename K>
+    struct insert_ : ::boost::mpl::push_front<Set,K>
+    {
+    };
 }}} // namespace boost::parameter::aux
 
-# else
+#include <boost/mpl/bool.hpp>
+#include <boost/mpl/if.hpp>
+#include <boost/mpl/end.hpp>
+#include <boost/mpl/find.hpp>
+#include <boost/type_traits/is_same.hpp>
 
-#  include <boost/mpl/list.hpp>
-#  include <boost/mpl/end.hpp>
-#  include <boost/mpl/find.hpp>
-#  include <boost/mpl/not.hpp>
-#  include <boost/mpl/push_front.hpp>
+namespace boost { namespace parameter { namespace aux {
+
+    template <typename Set, typename K>
+    struct has_key_
+    {
+        typedef typename ::boost::mpl::find<Set,K>::type iter;
+        typedef typename ::boost::mpl::if_<
+            ::boost::is_same<iter,typename ::boost::mpl::end<Set>::type>
+          , ::boost::mpl::false_
+          , ::boost::mpl::true_
+        >::type type;
+    };
+}}} // namespace boost::parameter::aux
+
+#else   // !BOOST_PARAMETER_CAN_USE_MP11 && Borland workarounds not needed
+#include <boost/mpl/set/set0.hpp>
 
 namespace boost { namespace parameter { namespace aux {
 
-typedef mpl::list0<> set0;
+    typedef ::boost::mpl::set0<> set0;
+}}} // namespace boost::parameter::aux
 
-template <class Set, class K>
-struct insert_
-{
-    typedef typename mpl::push_front<Set, K>::type type;
-};
+#include <boost/mpl/insert.hpp>
 
-template <class Set, class K>
-struct has_key_
-{
-    typedef typename mpl::find<Set, K>::type iter;
-    typedef mpl::not_<
-        is_same<iter, typename mpl::end<Set>::type> 
-    > type;
-};
+namespace boost { namespace parameter { namespace aux {
 
+    template <typename Set, typename K>
+    struct insert_ : ::boost::mpl::insert<Set,K>
+    {
+    };
 }}} // namespace boost::parameter::aux
 
-# endif
+#include <boost/mpl/has_key.hpp>
 
+namespace boost { namespace parameter { namespace aux {
+
+    template <typename Set, typename K>
+    struct has_key_ : ::boost::mpl::has_key<Set,K>
+    {
+    };
+}}} // namespace boost::parameter::aux
 
-#endif // BOOST_PARAMETER_SET_060912_HPP
+#endif  // BOOST_PARAMETER_CAN_USE_MP11 || Borland workarounds needed
+#endif  // include guard