class F, class... L> struct mp_transform_if_impl
{
// the stupid quote-unquote dance avoids "pack expansion used as argument for non-pack parameter of alias template"
+
+ using Qp = mp_quote;
+ using Qf = mp_quote;
+
#if defined( BOOST_MSVC ) && BOOST_WORKAROUND( BOOST_MSVC, <= 1910 )
- template struct _f_ { using type = mp_eval_if, U...>>, mp_first>, mp_quote::template fn, U...>; };
+ template struct _f_ { using type = mp_eval_if_q>, mp_first>, Qf, U...>; };
template using _f = typename _f_::type;
#else
- template using _f = mp_eval_if, U...>>, mp_first>, mp_quote::template fn, U...>;
+ template using _f = mp_eval_if_q>, mp_first>, Qf, U...>;
#endif
@@ -142,6 +146,7 @@ template class P, template class F, class... L> str
} // namespace detail
template class P, template class F, class... L> using mp_transform_if = typename detail::mp_transform_if_impl::type;
+template using mp_transform_if_q = typename detail::mp_transform_if_impl::type;
// mp_fill
namespace detail
diff --git a/test/Jamfile.v2 b/test/Jamfile.v2
index 277bc4f..362df65 100644
--- a/test/Jamfile.v2
+++ b/test/Jamfile.v2
@@ -37,6 +37,7 @@ run mp_clear.cpp : : : $(REQ) ;
run mp_transform.cpp : : : $(REQ) ;
run mp_transform_sf.cpp : : : $(REQ) ;
run mp_transform_if.cpp : : : $(REQ) ;
+run mp_transform_if_q.cpp : : : $(REQ) ;
run mp_fill.cpp : : : $(REQ) ;
run mp_count.cpp : : : $(REQ) ;
run mp_count_if.cpp : : : $(REQ) ;
diff --git a/test/mp_transform_if_q.cpp b/test/mp_transform_if_q.cpp
new file mode 100644
index 0000000..b2087be
--- /dev/null
+++ b/test/mp_transform_if_q.cpp
@@ -0,0 +1,87 @@
+
+// Copyright 2015, 2017 Peter Dimov.
+//
+// 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
+
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+struct X1 {};
+struct X2 {};
+struct X3 {};
+struct X4 {};
+
+using boost::mp11::mp_not;
+using boost::mp11::mp_quote;
+
+template using add_pointer = T*;
+using Q_add_pointer = mp_quote;
+
+template using is_not_ref = mp_not>;
+using Q_is_not_ref = mp_quote;
+
+template using second = T2;
+using Q_second = mp_quote;
+
+template using third = T3;
+using Q_third = mp_quote;
+
+template using fourth = T4;
+using Q_fourth = mp_quote;
+
+template using fifth = T5;
+using Q_fifth = mp_quote;
+
+int main()
+{
+ using boost::mp11::mp_list;
+ using boost::mp11::mp_transform_if_q;
+ using boost::mp11::mp_size_t;
+ using boost::mp11::mp_size;
+ using boost::mp11::mp_fill;
+ using boost::mp11::mp_iota;
+
+ using L1 = mp_list;
+
+ BOOST_TEST_TRAIT_TRUE((std::is_same, mp_list>));
+
+ using L2 = std::tuple;
+
+ BOOST_TEST_TRAIT_TRUE((std::is_same, std::tuple>));
+
+ using L3 = std::pair;
+
+ BOOST_TEST_TRAIT_TRUE((std::is_same, std::pair>));
+
+ //
+
+ BOOST_TEST_TRAIT_TRUE((std::is_same>, mp_list>));
+ BOOST_TEST_TRAIT_TRUE((std::is_same>, std::tuple>));
+ BOOST_TEST_TRAIT_TRUE((std::is_same>, std::pair>));
+
+ BOOST_TEST_TRAIT_TRUE((std::is_same>>, mp_list, X2&, mp_size_t<2>, X4 const&>>));
+ BOOST_TEST_TRAIT_TRUE((std::is_same>>, std::tuple, X2&, mp_size_t<2>, X4 const&>>));
+ BOOST_TEST_TRAIT_TRUE((std::is_same>>, std::pair, X2&>>));
+
+ BOOST_TEST_TRAIT_TRUE((std::is_same>>, mp_list, X2&, mp_size_t<2>, X4 const&>>));
+ BOOST_TEST_TRAIT_TRUE((std::is_same>>, std::tuple, X2&, mp_size_t<2>, X4 const&>>));
+ BOOST_TEST_TRAIT_TRUE((std::is_same>>, std::pair, X2&>>));
+
+ BOOST_TEST_TRAIT_TRUE((std::is_same>>, mp_list, X2&, mp_size_t<2>, X4 const&>>));
+ BOOST_TEST_TRAIT_TRUE((std::is_same>>, std::tuple, X2&, mp_size_t<2>, X4 const&>>));
+ BOOST_TEST_TRAIT_TRUE((std::is_same>>, std::pair, X2&>>));
+
+ //
+
+ return boost::report_errors();
+}