forked from boostorg/mp11
Implement mp_transform_if in terms of mp_transform
This commit is contained in:
@@ -26,6 +26,8 @@ template<class T> using add_pointer = T*;
|
||||
template<class T, class...> using is_not_ref = mp_not<std::is_reference<T>>;
|
||||
template<class T1, class T2> using second = T2;
|
||||
template<class T1, class T2, class T3> using third = T3;
|
||||
template<class T1, class T2, class T3, class T4> using fourth = T4;
|
||||
template<class T1, class T2, class T3, class T4, class T5> using fifth = T5;
|
||||
|
||||
int main()
|
||||
{
|
||||
@@ -58,6 +60,14 @@ int main()
|
||||
BOOST_TEST_TRAIT_TRUE((std::is_same<mp_transform_if<is_not_ref, third, L2, L2, mp_iota<mp_size<L2>>>, std::tuple<mp_size_t<0>, X2&, mp_size_t<2>, X4 const&>>));
|
||||
BOOST_TEST_TRAIT_TRUE((std::is_same<mp_transform_if<is_not_ref, third, L3, L3, mp_iota<mp_size<L3>>>, std::pair<mp_size_t<0>, X2&>>));
|
||||
|
||||
BOOST_TEST_TRAIT_TRUE((std::is_same<mp_transform_if<is_not_ref, fourth, L1, L1, L1, mp_iota<mp_size<L1>>>, mp_list<mp_size_t<0>, X2&, mp_size_t<2>, X4 const&>>));
|
||||
BOOST_TEST_TRAIT_TRUE((std::is_same<mp_transform_if<is_not_ref, fourth, L2, L2, L2, mp_iota<mp_size<L2>>>, std::tuple<mp_size_t<0>, X2&, mp_size_t<2>, X4 const&>>));
|
||||
BOOST_TEST_TRAIT_TRUE((std::is_same<mp_transform_if<is_not_ref, fourth, L3, L3, L3, mp_iota<mp_size<L3>>>, std::pair<mp_size_t<0>, X2&>>));
|
||||
|
||||
BOOST_TEST_TRAIT_TRUE((std::is_same<mp_transform_if<is_not_ref, fifth, L1, L1, L1, L1, mp_iota<mp_size<L1>>>, mp_list<mp_size_t<0>, X2&, mp_size_t<2>, X4 const&>>));
|
||||
BOOST_TEST_TRAIT_TRUE((std::is_same<mp_transform_if<is_not_ref, fifth, L2, L2, L2, L2, mp_iota<mp_size<L2>>>, std::tuple<mp_size_t<0>, X2&, mp_size_t<2>, X4 const&>>));
|
||||
BOOST_TEST_TRAIT_TRUE((std::is_same<mp_transform_if<is_not_ref, fifth, L3, L3, L3, L3, mp_iota<mp_size<L3>>>, std::pair<mp_size_t<0>, X2&>>));
|
||||
|
||||
//
|
||||
|
||||
return boost::report_errors();
|
||||
|
||||
Reference in New Issue
Block a user