From 7b2d3f6e41b7158a665b54d5b7f60f4bbc6fa329 Mon Sep 17 00:00:00 2001
From: CromwellEnage <32967088+CromwellEnage@users.noreply.github.com>
Date: Mon, 21 Jan 2019 01:14:59 -0500
Subject: [PATCH] Reinstate MP11 support for ArgumentPacks
Argument packs qualify as Boost.MP11-style maps as well as MPL sequences. These maps store the keyword tag types as their keys.
---
doc/html/reference.html | 8 +-
doc/reference.rst | 6 +-
include/boost/parameter/aux_/arg_list.hpp | 142 ++++++++++++++++--
.../parameter/aux_/pack/make_arg_list.hpp | 28 +++-
include/boost/parameter/aux_/tag.hpp | 38 ++++-
.../boost/parameter/aux_/tagged_argument.hpp | 81 ++++++++--
.../parameter/aux_/tagged_argument_fwd.hpp | 10 ++
include/boost/parameter/compose.hpp | 13 ++
test/compose.cpp | 10 +-
test/deduced.hpp | 13 +-
test/mpl.cpp | 29 +++-
test/singular.cpp | 7 +-
12 files changed, 330 insertions(+), 55 deletions(-)
diff --git a/doc/html/reference.html b/doc/html/reference.html
index 2487f5a..268573c 100644
--- a/doc/html/reference.html
+++ b/doc/html/reference.html
@@ -400,7 +400,13 @@ href="../../../mpl/doc/refmanual/associative-sequence.html">MPL Associative Sequence consisting of the keyword tag types in
its tagged
-references. The s. If BOOST_PARAMETER_CAN_USE_MP11 is defined, then every ArgumentPack is also a valid Boost.MP11 map whose keys are keyword tag types. The test/singular.cpp, test/compose.cpp, and
>::type;
- using value_type = ::boost::mp11::mp_if<
- _holds_maybe
- , reference
- , typename TaggedArg::value_type
- >;
+ using value_type = ::boost::mp11
+ ::mp_if<_holds_maybe,reference,typename TaggedArg::value_type>;
#else // !defined(BOOST_PARAMETER_CAN_USE_MP11)
typedef typename ::boost::mpl::eval_if<
_holds_maybe
@@ -418,8 +415,8 @@ namespace boost { namespace parameter { namespace aux {
inline BOOST_CONSTEXPR reference
operator[](::boost::parameter::keyword const&) const
{
-#if defined(BOOST_PARAMETER_CAN_USE_MP11) && \
- !defined(BOOST_NO_CXX14_CONSTEXPR)
+#if !defined(BOOST_NO_CXX14_CONSTEXPR)
+#if defined(BOOST_PARAMETER_CAN_USE_MP11)
static_assert(!_holds_maybe::value, "must not hold maybe");
#elif !( \
BOOST_WORKAROUND(BOOST_GCC, >= 40700) && \
@@ -427,6 +424,7 @@ namespace boost { namespace parameter { namespace aux {
) && !BOOST_WORKAROUND(BOOST_GCC, >= 50000) && \
!BOOST_WORKAROUND(BOOST_MSVC, < 1910)
BOOST_MPL_ASSERT_NOT((_holds_maybe));
+#endif
#endif
return this->arg.get_value();
}
@@ -455,8 +453,8 @@ namespace boost { namespace parameter { namespace aux {
BOOST_PARAMETER_lazy_default_fallback const&
) const
{
-#if defined(BOOST_PARAMETER_CAN_USE_MP11) && \
- !defined(BOOST_NO_CXX14_CONSTEXPR)
+#if !defined(BOOST_NO_CXX14_CONSTEXPR)
+#if defined(BOOST_PARAMETER_CAN_USE_MP11)
static_assert(!_holds_maybe::value, "must not hold maybe");
#elif !( \
BOOST_WORKAROUND(BOOST_GCC, >= 40700) && \
@@ -464,6 +462,7 @@ namespace boost { namespace parameter { namespace aux {
) && !BOOST_WORKAROUND(BOOST_GCC, >= 50000) && \
!BOOST_WORKAROUND(BOOST_MSVC, < 1910)
BOOST_MPL_ASSERT_NOT((_holds_maybe));
+#endif
#endif
return this->arg.get_value();
}
@@ -1028,6 +1027,131 @@ namespace boost { namespace parameter { namespace aux {
#endif // BOOST_PARAMETER_HAS_PERFECT_FORWARDING
+#if defined(BOOST_PARAMETER_CAN_USE_MP11)
+
+namespace boost { namespace parameter { namespace aux {
+
+ template
+ struct arg_list_cons;
+
+ template <>
+ struct arg_list_cons<>
+ {
+ using type = ::boost::parameter::aux::empty_arg_list;
+ };
+
+ template
+ struct arg_list_cons
+ {
+ using type = ::boost::parameter::aux::arg_list<
+ typename ArgTuple0::tagged_arg
+ , typename ::boost::parameter::aux::arg_list_cons::type
+ , typename ArgTuple0::emits_errors
+ >;
+ };
+
+ template <
+ typename Keyword
+ , typename TaggedArg
+ , typename EmitsErrors = ::boost::mp11::mp_true
+ >
+ struct flat_like_arg_tuple
+ {
+ using tagged_arg = TaggedArg;
+ using emits_errors = EmitsErrors;
+ };
+
+ template
+ class flat_like_arg_list
+ : public ::boost::parameter::aux::arg_list_cons::type
+ {
+ using _base_type = typename ::boost::parameter::aux
+ ::arg_list_cons::type;
+
+ public:
+ inline BOOST_CONSTEXPR flat_like_arg_list(
+ typename _base_type::tagged_arg const& head
+ , typename _base_type::tail_type const& tail
+ ) : _base_type(head, tail)
+ {
+ }
+
+ template
+ inline BOOST_CONSTEXPR flat_like_arg_list(Args&&... args)
+ : _base_type(::std::forward(args)...)
+ {
+ }
+
+ using _base_type::operator[];
+ using _base_type::satisfies;
+
+ // Comma operator to compose argument list without using parameters<>.
+ // Useful for argument lists with undetermined length.
+ template
+ inline BOOST_CONSTEXPR ::boost::parameter::aux::flat_like_arg_list<
+ ::boost::parameter::aux::flat_like_arg_tuple<
+ typename TaggedArg::base_type::key_type
+ , typename TaggedArg::base_type
+ >
+ , ArgTuples...
+ >
+ operator,(TaggedArg const& x) const
+ {
+ return ::boost::parameter::aux::flat_like_arg_list<
+ ::boost::parameter::aux::flat_like_arg_tuple<
+ typename TaggedArg::base_type::key_type
+ , typename TaggedArg::base_type
+ >
+ , ArgTuples...
+ >(
+ static_cast(x)
+ , static_cast<_base_type const&>(*this)
+ );
+ }
+ };
+
+ template <>
+ class flat_like_arg_list<>
+ : public ::boost::parameter::aux::empty_arg_list
+ {
+ using _base_type = ::boost::parameter::aux::empty_arg_list;
+
+ public:
+ template
+ inline BOOST_CONSTEXPR flat_like_arg_list(Args&&... args)
+ : _base_type(::std::forward(args)...)
+ {
+ }
+
+ using _base_type::operator[];
+ using _base_type::satisfies;
+
+ // Comma operator to compose argument list without using parameters<>.
+ // Useful for argument lists with undetermined length.
+ template
+ inline BOOST_CONSTEXPR ::boost::parameter::aux::flat_like_arg_list<
+ ::boost::parameter::aux::flat_like_arg_tuple<
+ typename TaggedArg::base_type::key_type
+ , typename TaggedArg::base_type
+ >
+ >
+ operator,(TaggedArg const& x) const
+ {
+ return ::boost::parameter::aux::flat_like_arg_list<
+ ::boost::parameter::aux::flat_like_arg_tuple<
+ typename TaggedArg::base_type::key_type
+ , typename TaggedArg::base_type
+ >
+ >(
+ static_cast(x)
+ , static_cast<_base_type const&>(*this)
+ );
+ }
+ };
+}}} // namespace boost::parameter::aux
+
+#endif // BOOST_PARAMETER_CAN_USE_MP11
+
#include
namespace boost { namespace parameter { namespace aux {
diff --git a/include/boost/parameter/aux_/pack/make_arg_list.hpp b/include/boost/parameter/aux_/pack/make_arg_list.hpp
index ba008a5..c43ac5c 100644
--- a/include/boost/parameter/aux_/pack/make_arg_list.hpp
+++ b/include/boost/parameter/aux_/pack/make_arg_list.hpp
@@ -1,4 +1,5 @@
// Copyright David Abrahams, Daniel Wallin 2003.
+// Copyright Cromwell D. Enage 2018.
// 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)
@@ -50,6 +51,21 @@ namespace boost { namespace parameter { namespace aux {
namespace boost { namespace parameter { namespace aux {
+#if defined(BOOST_PARAMETER_CAN_USE_MP11)
+ template
+ struct append_to_make_arg_list
+ {
+ using type = ::boost::mp11::mp_push_front<
+ ArgumentPack
+ , ::boost::parameter::aux::flat_like_arg_tuple<
+ typename TaggedArg::key_type
+ , TaggedArg
+ , EmitsErrors
+ >
+ >;
+ };
+#endif
+
// Borland needs the insane extra-indirection workaround below so that
// it doesn't magically drop the const qualifier from the argument type.
template <
@@ -238,12 +254,12 @@ namespace boost { namespace parameter { namespace aux {
#endif
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
- using _argument_pack = ::boost::mp11::mp_if<
+ using _argument_pack = typename ::boost::mp11::mp_if<
::std::is_same<_tagged,::boost::parameter::void_>
- , ArgumentPack
+ , ::boost::mp11::mp_identity
, ::boost::parameter::aux
- ::arg_list<_tagged,ArgumentPack,EmitsErrors>
- >;
+ ::append_to_make_arg_list
+ >::type;
#else // !defined(BOOST_PARAMETER_CAN_USE_MP11)
typedef typename ::boost::mpl::if_<
::boost::is_same<_tagged,::boost::parameter::void_>
@@ -402,7 +418,11 @@ namespace boost { namespace parameter { namespace aux {
, ::boost::mpl::true_
#endif
, ::boost::parameter::aux::set0
+#if defined(BOOST_PARAMETER_CAN_USE_MP11)
+ , ::boost::parameter::aux::flat_like_arg_list<>
+#else
, ::boost::parameter::aux::empty_arg_list
+#endif
, ::boost::parameter::void_
, EmitsErrors
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
diff --git a/include/boost/parameter/aux_/tag.hpp b/include/boost/parameter/aux_/tag.hpp
index 48de907..0cba191 100644
--- a/include/boost/parameter/aux_/tag.hpp
+++ b/include/boost/parameter/aux_/tag.hpp
@@ -24,17 +24,22 @@ namespace boost { namespace parameter { namespace aux {
template
struct tag_if_lvalue_reference
{
- typedef ::boost::parameter::aux::tagged_argument<
- Keyword
- , typename ::boost::parameter::aux::unwrap_cv_reference::type
- > type;
+ using type = ::boost::parameter::aux::tagged_argument_list_of_1<
+ ::boost::parameter::aux::tagged_argument<
+ Keyword
+ , typename ::boost::parameter::aux
+ ::unwrap_cv_reference::type
+ >
+ >;
};
template
struct tag_if_scalar
{
- typedef ::boost::parameter::aux
- ::tagged_argument::type> type;
+ using type = ::boost::parameter::aux::tagged_argument_list_of_1<
+ ::boost::parameter::aux
+ ::tagged_argument::type>
+ >;
};
template
@@ -42,7 +47,9 @@ namespace boost { namespace parameter { namespace aux {
::std::is_scalar::type>
, ::boost::parameter::aux::tag_if_scalar
, ::boost::mp11::mp_identity<
- ::boost::parameter::aux::tagged_argument_rref
+ ::boost::parameter::aux::tagged_argument_list_of_1<
+ ::boost::parameter::aux::tagged_argument_rref
+ >
>
>;
@@ -84,12 +91,27 @@ namespace boost { namespace parameter { namespace aux {
, ::boost::parameter::aux::is_cv_reference_wrapper
>::type
, ::boost::mpl::identity<
- ::boost::parameter::aux::tagged_argument
+#if defined(BOOST_PARAMETER_CAN_USE_MP11)
+ ::boost::parameter::aux::tagged_argument_list_of_1<
+#endif
+ ::boost::parameter::aux::tagged_argument
+#if defined(BOOST_PARAMETER_CAN_USE_MP11)
+ >
+#endif
>
, ::boost::mpl::if_<
::boost::is_scalar
+#if defined(BOOST_PARAMETER_CAN_USE_MP11)
+ , ::boost::parameter::aux::tagged_argument_list_of_1<
+ ::boost::parameter::aux::tagged_argument
+ >
+ , ::boost::parameter::aux::tagged_argument_list_of_1<
+ ::boost::parameter::aux::tagged_argument_rref
+ >
+#else
, ::boost::parameter::aux::tagged_argument
, ::boost::parameter::aux::tagged_argument_rref
+#endif
>
>::type type;
};
diff --git a/include/boost/parameter/aux_/tagged_argument.hpp b/include/boost/parameter/aux_/tagged_argument.hpp
index 449bf55..964dd8f 100644
--- a/include/boost/parameter/aux_/tagged_argument.hpp
+++ b/include/boost/parameter/aux_/tagged_argument.hpp
@@ -219,6 +219,7 @@ namespace boost { namespace parameter { namespace aux {
#endif
};
+#if !defined(BOOST_PARAMETER_CAN_USE_MP11)
// Comma operator to compose argument list without using parameters<>.
// Useful for argument lists with undetermined length.
template
@@ -226,7 +227,7 @@ namespace boost { namespace parameter { namespace aux {
::boost::parameter::aux::tagged_argument
, ::boost::parameter::aux::arg_list<
::boost::parameter::aux::tagged_argument
- >
+ >
>
operator,(
::boost::parameter::aux
@@ -237,7 +238,7 @@ namespace boost { namespace parameter { namespace aux {
::boost::parameter::aux::tagged_argument
, ::boost::parameter::aux::arg_list<
::boost::parameter::aux::tagged_argument
- >
+ >
>(
*this
, ::boost::parameter::aux::arg_list<
@@ -251,7 +252,7 @@ namespace boost { namespace parameter { namespace aux {
::boost::parameter::aux::tagged_argument
, ::boost::parameter::aux::arg_list<
::boost::parameter::aux::tagged_argument_rref
- >
+ >
>
operator,(
::boost::parameter::aux
@@ -262,7 +263,7 @@ namespace boost { namespace parameter { namespace aux {
::boost::parameter::aux::tagged_argument
, boost::parameter::aux::arg_list<
boost::parameter::aux::tagged_argument_rref
- >
+ >
>(
*this
, ::boost::parameter::aux::arg_list<
@@ -271,6 +272,7 @@ namespace boost { namespace parameter { namespace aux {
>(x, ::boost::parameter::aux::empty_arg_list())
);
}
+#endif // BOOST_PARAMETER_CAN_USE_MP11
// Accessor interface.
inline BOOST_CONSTEXPR reference get_value() const
@@ -428,6 +430,7 @@ namespace boost { namespace parameter { namespace aux {
#endif
};
+#if !defined(BOOST_PARAMETER_CAN_USE_MP11)
// Comma operator to compose argument list without using parameters<>.
// Useful for argument lists with undetermined length.
template
@@ -435,7 +438,7 @@ namespace boost { namespace parameter { namespace aux {
::boost::parameter::aux::tagged_argument_rref
, ::boost::parameter::aux::arg_list<
::boost::parameter::aux::tagged_argument
- >
+ >
>
operator,(
::boost::parameter::aux
@@ -446,7 +449,7 @@ namespace boost { namespace parameter { namespace aux {
::boost::parameter::aux::tagged_argument_rref
, ::boost::parameter::aux::arg_list<
::boost::parameter::aux::tagged_argument
- >
+ >
>(
*this
, ::boost::parameter::aux::arg_list<
@@ -460,7 +463,7 @@ namespace boost { namespace parameter { namespace aux {
::boost::parameter::aux::tagged_argument_rref
, ::boost::parameter::aux::arg_list<
::boost::parameter::aux::tagged_argument_rref
- >
+ >
>
operator,(
::boost::parameter::aux
@@ -472,7 +475,7 @@ namespace boost { namespace parameter { namespace aux {
, ::boost::parameter::aux::arg_list<
::boost::parameter::aux
::tagged_argument_rref
- >
+ >
>(
*this
, ::boost::parameter::aux::arg_list<
@@ -483,6 +486,7 @@ namespace boost { namespace parameter { namespace aux {
>(x, ::boost::parameter::aux::empty_arg_list())
);
}
+#endif // BOOST_PARAMETER_CAN_USE_MP11
// Accessor interface.
inline BOOST_CONSTEXPR reference get_value() const
@@ -568,10 +572,8 @@ namespace boost { namespace parameter { namespace aux {
// MPL sequence support
// Convenience for users
- typedef ::boost::parameter::aux::tagged_argument_rref<
- Keyword
- , Arg
- > type;
+ typedef ::boost::parameter::aux
+ ::tagged_argument_rref type;
// For the benefit of iterators
typedef ::boost::parameter::aux::empty_arg_list tail_type;
// For dispatching to sequence intrinsics
@@ -833,5 +835,60 @@ namespace boost { namespace parameter { namespace aux {
}}} // namespace boost::parameter::aux
#endif // BOOST_PARAMETER_HAS_PERFECT_FORWARDING
+
+#if defined(BOOST_PARAMETER_CAN_USE_MP11)
+
+namespace boost { namespace parameter { namespace aux {
+
+ template
+ struct tagged_argument_list_of_1 : public TaggedArg
+ {
+ using base_type = TaggedArg;
+
+ inline explicit BOOST_CONSTEXPR tagged_argument_list_of_1(
+ typename base_type::reference x
+ ) : base_type(static_cast(x))
+ {
+ }
+
+ inline BOOST_CONSTEXPR tagged_argument_list_of_1(
+ tagged_argument_list_of_1 const& copy
+ ) : base_type(static_cast(copy))
+ {
+ }
+
+ using base_type::operator[];
+ using base_type::satisfies;
+
+ template
+ inline BOOST_CONSTEXPR ::boost::parameter::aux::flat_like_arg_list<
+ ::boost::parameter::aux
+ ::flat_like_arg_tuple
+ , ::boost::parameter::aux::flat_like_arg_tuple<
+ typename TA2::base_type::key_type
+ , typename TA2::base_type
+ >
+ >
+ operator,(TA2 const& x) const
+ {
+ return boost::parameter::aux::flat_like_arg_list<
+ ::boost::parameter::aux
+ ::flat_like_arg_tuple
+ , ::boost::parameter::aux::flat_like_arg_tuple<
+ typename TA2::base_type::key_type
+ , typename TA2::base_type
+ >
+ >(
+ static_cast(*this)
+ , ::boost::parameter::aux::arg_list(
+ static_cast(x)
+ , ::boost::parameter::aux::empty_arg_list()
+ )
+ );
+ }
+ };
+}}} // namespace boost::parameter::aux
+
+#endif // BOOST_PARAMETER_CAN_USE_MP11
#endif // include guard
diff --git a/include/boost/parameter/aux_/tagged_argument_fwd.hpp b/include/boost/parameter/aux_/tagged_argument_fwd.hpp
index 11acf19..5f1e5a1 100644
--- a/include/boost/parameter/aux_/tagged_argument_fwd.hpp
+++ b/include/boost/parameter/aux_/tagged_argument_fwd.hpp
@@ -23,6 +23,16 @@ namespace boost { namespace parameter { namespace aux {
struct tagged_argument_rref;
}}} // namespace boost::parameter::aux
+#endif
+
+#if defined(BOOST_PARAMETER_CAN_USE_MP11)
+
+namespace boost { namespace parameter { namespace aux {
+
+ template
+ struct tagged_argument_list_of_1;
+}}} // namespace boost::parameter::aux
+
#endif
#endif // include guard
diff --git a/include/boost/parameter/compose.hpp b/include/boost/parameter/compose.hpp
index a53595f..0fd7ba1 100644
--- a/include/boost/parameter/compose.hpp
+++ b/include/boost/parameter/compose.hpp
@@ -22,6 +22,18 @@ namespace boost { namespace parameter {
namespace boost { namespace parameter { namespace aux {
+#if defined(BOOST_PARAMETER_CAN_USE_MP11)
+ template
+ struct compose_arg_list
+ {
+ using type = ::boost::parameter::aux::flat_like_arg_list<
+ ::boost::parameter::aux::flat_like_arg_tuple<
+ typename TaggedArgs::base_type::key_type
+ , typename TaggedArgs::base_type
+ >...
+ >;
+ };
+#else // !defined(BOOST_PARAMETER_CAN_USE_MP11)
template
struct compose_arg_list;
@@ -40,6 +52,7 @@ namespace boost { namespace parameter { namespace aux {
::compose_arg_list::type
> type;
};
+#endif // BOOST_PARAMETER_CAN_USE_MP11
}}} // namespace boost::parameter::aux
#include
diff --git a/test/compose.cpp b/test/compose.cpp
index 8d39464..069f0cb 100644
--- a/test/compose.cpp
+++ b/test/compose.cpp
@@ -36,7 +36,7 @@ namespace param {
#include
#include
-#if 0//defined(BOOST_PARAMETER_CAN_USE_MP11)
+#if defined(BOOST_PARAMETER_CAN_USE_MP11)
#include
#include
#include
@@ -58,7 +58,7 @@ namespace test {
template
A(ArgPack const& args) : i(args[param::a0]), j(args[param::a1])
{
-#if 0//defined(BOOST_PARAMETER_CAN_USE_MP11)
+#if defined(BOOST_PARAMETER_CAN_USE_MP11)
static_assert(
boost::mp11::mp_map_contains::value
, "param::tag::a0 must be in ArgPack"
@@ -248,7 +248,7 @@ namespace test {
, j(args[param::_lr])
, k(args[param::_lrc])
{
-#if 0//defined(BOOST_PARAMETER_CAN_USE_MP11)
+#if defined(BOOST_PARAMETER_CAN_USE_MP11)
static_assert(
boost::mp11::mp_map_contains::value
, "param::tag::lrc must be in ArgPack"
@@ -453,7 +453,7 @@ namespace test {
, j(args[param::_lr])
, k(args[param::_lrc])
{
-#if 0//defined(BOOST_PARAMETER_CAN_USE_MP11)
+#if defined(BOOST_PARAMETER_CAN_USE_MP11)
static_assert(
boost::mp11::mp_map_contains::value
, "param::tag::lrc must be in ArgPack"
@@ -470,7 +470,7 @@ namespace test {
, "param::tag::lrc must be found in ArgPack"
);
static_assert(
- std::is_same<
+ !std::is_same<
boost::mp11::mp_map_find
, void
>::value
diff --git a/test/deduced.hpp b/test/deduced.hpp
index 0b72985..551bf1e 100644
--- a/test/deduced.hpp
+++ b/test/deduced.hpp
@@ -10,7 +10,8 @@
#include
#include "basics.hpp"
-#if 0//defined(BOOST_PARAMETER_CAN_USE_MP11)
+#if defined(BOOST_PARAMETER_CAN_USE_MP11)
+#include
#include
#else
#include
@@ -43,7 +44,7 @@ namespace test {
template
static bool check_not_present(T const&)
{
-#if 0//defined(BOOST_PARAMETER_CAN_USE_MP11)
+#if defined(BOOST_PARAMETER_CAN_USE_MP11)
static_assert(
std::is_same::value
, "T == test::not_present_tag"
@@ -75,7 +76,7 @@ namespace test {
}
template
-#if 0//defined(BOOST_PARAMETER_CAN_USE_MP11)
+#if defined(BOOST_PARAMETER_CAN_USE_MP11)
void operator()(K&&) const
#else
void operator()(K) const
@@ -90,8 +91,10 @@ namespace test {
template
void check0(E const& e, A const& args)
{
-#if 0//defined(BOOST_PARAMETER_CAN_USE_MP11)
- boost::mp11::mp_for_each(test::assert_expected(e, args));
+#if defined(BOOST_PARAMETER_CAN_USE_MP11)
+ boost::mp11::mp_for_each >(
+ test::assert_expected(e, args)
+ );
#else
boost::mpl::for_each(test::assert_expected(e, args));
#endif
diff --git a/test/mpl.cpp b/test/mpl.cpp
index 976c1de..d03ce4d 100644
--- a/test/mpl.cpp
+++ b/test/mpl.cpp
@@ -1,4 +1,5 @@
// Copyright David Abrahams 2006.
+// Copyright Cromwell D. Enage 2019.
// 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)
@@ -13,15 +14,29 @@
#include
#include "basics.hpp"
-#if 0//defined(BOOST_PARAMETER_CAN_USE_MP11)
+#if defined(BOOST_PARAMETER_CAN_USE_MP11)
#include
+#include
#include
#include
#endif
namespace test {
-#if 0//defined(BOOST_PARAMETER_CAN_USE_MP11)
+#if defined(BOOST_PARAMETER_CAN_USE_MP11)
+ template
+ struct assert_in_map
+ {
+ template
+ void operator()(T&&)
+ {
+ static_assert(
+ boost::mp11::mp_map_contains