forked from boostorg/mp11
Add mp_set_contains, mp_set_push_back, mp_set_push_front.
This commit is contained in:
@@ -8,12 +8,73 @@
|
||||
// See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
#include <boost/mp11/utility.hpp>
|
||||
#include <type_traits>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
|
||||
// mp_set_contains<S, T>
|
||||
// mp_set_contains<S, V>
|
||||
namespace detail
|
||||
{
|
||||
|
||||
template<class S, class V> struct mp_set_contains_impl;
|
||||
|
||||
template<template<class...> class L, class... T, class V> struct mp_set_contains_impl<L<T...>, V>
|
||||
{
|
||||
using type = mp_to_bool<std::is_base_of<mp_identity<V>, mp_inherit<mp_identity<T>...>>>;
|
||||
};
|
||||
|
||||
} // namespace detail
|
||||
|
||||
template<class S, class V> using mp_set_contains = typename detail::mp_set_contains_impl<S, V>::type;
|
||||
|
||||
// mp_set_push_back<S, T...>
|
||||
namespace detail
|
||||
{
|
||||
|
||||
template<class S, class... T> struct mp_set_push_back_impl;
|
||||
|
||||
template<template<class...> class L, class... U> struct mp_set_push_back_impl<L<U...>>
|
||||
{
|
||||
using type = L<U...>;
|
||||
};
|
||||
|
||||
template<template<class...> class L, class... U, class T1, class... T> struct mp_set_push_back_impl<L<U...>, T1, T...>
|
||||
{
|
||||
using S = mp_if<mp_set_contains<L<U...>, T1>, L<U...>, L<U..., T1>>;
|
||||
using type = typename mp_set_push_back_impl<S, T...>::type;
|
||||
};
|
||||
|
||||
} // namespace detail
|
||||
|
||||
template<class S, class... T> using mp_set_push_back = typename detail::mp_set_push_back_impl<S, T...>::type;
|
||||
|
||||
// mp_set_push_front<S, T...>
|
||||
namespace detail
|
||||
{
|
||||
|
||||
template<class S, class... T> struct mp_set_push_front_impl;
|
||||
|
||||
template<template<class...> class L, class... U> struct mp_set_push_front_impl<L<U...>>
|
||||
{
|
||||
using type = L<U...>;
|
||||
};
|
||||
|
||||
template<template<class...> class L, class... U, class T1> struct mp_set_push_front_impl<L<U...>, T1>
|
||||
{
|
||||
using type = mp_if<mp_set_contains<L<U...>, T1>, L<U...>, L<T1, U...>>;
|
||||
};
|
||||
|
||||
template<template<class...> class L, class... U, class T1, class... T> struct mp_set_push_front_impl<L<U...>, T1, T...>
|
||||
{
|
||||
using S = typename mp_set_push_front_impl<L<U...>, T...>::type;
|
||||
using type = typename mp_set_push_front_impl<S, T1>::type;
|
||||
};
|
||||
|
||||
} // namespace detail
|
||||
|
||||
template<class S, class... T> using mp_set_push_front = typename detail::mp_set_push_front_impl<S, T...>::type;
|
||||
|
||||
} // namespace boost
|
||||
|
||||
|
@@ -25,6 +25,8 @@ run mp_push_front.cpp : : : $(REQ) ;
|
||||
run mp_push_back.cpp : : : $(REQ) ;
|
||||
run mp_rename.cpp : : : $(REQ) ;
|
||||
run mp_append.cpp : : : $(REQ) ;
|
||||
|
||||
# algorithm
|
||||
run mp_assign.cpp : : : $(REQ) ;
|
||||
run mp_clear.cpp : : : $(REQ) ;
|
||||
run mp_transform.cpp : : : $(REQ) ;
|
||||
@@ -71,3 +73,8 @@ run integer_sequence.cpp : : : $(REQ) ;
|
||||
# tuple_for_each
|
||||
run tuple_for_each.cpp : : : $(REQ) ;
|
||||
run tuple_for_each_cx.cpp : : : $(REQ) ;
|
||||
|
||||
# set
|
||||
run mp_set_contains.cpp : : : $(REQ) ;
|
||||
run mp_set_push_back.cpp : : : $(REQ) ;
|
||||
run mp_set_push_front.cpp : : : $(REQ) ;
|
||||
|
83
test/mp_set_contains.cpp
Normal file
83
test/mp_set_contains.cpp
Normal file
@@ -0,0 +1,83 @@
|
||||
|
||||
// Copyright 2015 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 <boost/mp11/set.hpp>
|
||||
#include <boost/mp11/list.hpp>
|
||||
#include <boost/mp11/integral.hpp>
|
||||
#include <boost/core/lightweight_test_trait.hpp>
|
||||
#include <type_traits>
|
||||
#include <tuple>
|
||||
|
||||
int main()
|
||||
{
|
||||
using boost::mp_list;
|
||||
using boost::mp_set_contains;
|
||||
using boost::mp_true;
|
||||
using boost::mp_false;
|
||||
|
||||
{
|
||||
using L1 = mp_list<>;
|
||||
|
||||
BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_contains<L1, void>, mp_false>));
|
||||
BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_contains<L1, int>, mp_false>));
|
||||
|
||||
using L2 = mp_list<void>;
|
||||
|
||||
BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_contains<L2, void>, mp_true>));
|
||||
BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_contains<L2, int>, mp_false>));
|
||||
|
||||
using L3 = mp_list<void, int>;
|
||||
|
||||
BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_contains<L3, void>, mp_true>));
|
||||
BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_contains<L3, int>, mp_true>));
|
||||
BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_contains<L3, void const>, mp_false>));
|
||||
|
||||
using L4 = mp_list<void, int, char[]>;
|
||||
|
||||
BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_contains<L4, void>, mp_true>));
|
||||
BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_contains<L4, int>, mp_true>));
|
||||
BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_contains<L4, char[]>, mp_true>));
|
||||
BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_contains<L4, void const>, mp_false>));
|
||||
}
|
||||
|
||||
{
|
||||
using L1 = std::tuple<>;
|
||||
|
||||
BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_contains<L1, void>, mp_false>));
|
||||
BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_contains<L1, int>, mp_false>));
|
||||
|
||||
using L2 = std::tuple<void>;
|
||||
|
||||
BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_contains<L2, void>, mp_true>));
|
||||
BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_contains<L2, int>, mp_false>));
|
||||
|
||||
using L3 = std::tuple<void, int>;
|
||||
|
||||
BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_contains<L3, void>, mp_true>));
|
||||
BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_contains<L3, int>, mp_true>));
|
||||
BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_contains<L3, void const>, mp_false>));
|
||||
|
||||
using L4 = std::tuple<void, int, char[]>;
|
||||
|
||||
BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_contains<L4, void>, mp_true>));
|
||||
BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_contains<L4, int>, mp_true>));
|
||||
BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_contains<L4, char[]>, mp_true>));
|
||||
BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_contains<L4, void const>, mp_false>));
|
||||
}
|
||||
|
||||
{
|
||||
using L3 = std::pair<void, int>;
|
||||
|
||||
BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_contains<L3, void>, mp_true>));
|
||||
BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_contains<L3, int>, mp_true>));
|
||||
BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_contains<L3, void const>, mp_false>));
|
||||
}
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
122
test/mp_set_push_back.cpp
Normal file
122
test/mp_set_push_back.cpp
Normal file
@@ -0,0 +1,122 @@
|
||||
|
||||
// Copyright 2015 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 <boost/mp11/set.hpp>
|
||||
#include <boost/mp11/list.hpp>
|
||||
#include <boost/core/lightweight_test_trait.hpp>
|
||||
#include <type_traits>
|
||||
#include <tuple>
|
||||
|
||||
int main()
|
||||
{
|
||||
using boost::mp_list;
|
||||
using boost::mp_set_push_back;
|
||||
|
||||
{
|
||||
using L1 = mp_list<>;
|
||||
|
||||
BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_push_back<L1>, L1>));
|
||||
|
||||
BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_push_back<L1, void>, mp_list<void>>));
|
||||
BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_push_back<L1, int>, mp_list<int>>));
|
||||
BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_push_back<L1, void, int>, mp_list<void, int>>));
|
||||
BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_push_back<L1, void, int, char[]>, mp_list<void, int, char[]>>));
|
||||
BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_push_back<L1, void, int, void, int, void, int>, mp_list<void, int>>));
|
||||
}
|
||||
|
||||
{
|
||||
using L2 = mp_list<void>;
|
||||
|
||||
BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_push_back<L2>, L2>));
|
||||
BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_push_back<L2, void>, L2>));
|
||||
|
||||
BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_push_back<L2, int>, mp_list<void, int>>));
|
||||
BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_push_back<L2, int, void>, mp_list<void, int>>));
|
||||
BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_push_back<L2, int, int, int, void, void, void>, mp_list<void, int>>));
|
||||
}
|
||||
|
||||
{
|
||||
using L3 = mp_list<void, int>;
|
||||
|
||||
BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_push_back<L3>, L3>));
|
||||
BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_push_back<L3, void>, L3>));
|
||||
BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_push_back<L3, int>, L3>));
|
||||
BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_push_back<L3, int, int, int, void, void, void>, L3>));
|
||||
|
||||
BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_push_back<L3, void const>, mp_list<void, int, void const>>));
|
||||
BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_push_back<L3, int, char[], int, char[], void, char[], void, char[]>, mp_list<void, int, char[]>>));
|
||||
}
|
||||
|
||||
{
|
||||
using L4 = mp_list<void, int, char[]>;
|
||||
|
||||
BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_push_back<L4>, L4>));
|
||||
BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_push_back<L4, void>, L4>));
|
||||
BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_push_back<L4, int>, L4>));
|
||||
BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_push_back<L4, char[]>, L4>));
|
||||
BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_push_back<L4, void, int, char[], void, int, char[]>, L4>));
|
||||
|
||||
BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_push_back<L4, void const>, mp_list<void, int, char[], void const>>));
|
||||
BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_push_back<L4, void const, int const, char const[]>, mp_list<void, int, char[], void const, int const, char const[]>>));
|
||||
BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_push_back<L4, void, void const, int, int const, char[], char const[]>, mp_list<void, int, char[], void const, int const, char const[]>>));
|
||||
}
|
||||
|
||||
//
|
||||
|
||||
{
|
||||
using L1 = std::tuple<>;
|
||||
|
||||
BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_push_back<L1>, L1>));
|
||||
|
||||
BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_push_back<L1, void>, std::tuple<void>>));
|
||||
BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_push_back<L1, int>, std::tuple<int>>));
|
||||
BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_push_back<L1, void, int>, std::tuple<void, int>>));
|
||||
BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_push_back<L1, void, int, char[]>, std::tuple<void, int, char[]>>));
|
||||
BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_push_back<L1, void, int, void, int, void, int>, std::tuple<void, int>>));
|
||||
}
|
||||
|
||||
{
|
||||
using L2 = std::tuple<void>;
|
||||
|
||||
BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_push_back<L2>, L2>));
|
||||
BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_push_back<L2, void>, L2>));
|
||||
|
||||
BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_push_back<L2, int>, std::tuple<void, int>>));
|
||||
BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_push_back<L2, int, void>, std::tuple<void, int>>));
|
||||
BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_push_back<L2, int, int, int, void, void, void>, std::tuple<void, int>>));
|
||||
}
|
||||
|
||||
{
|
||||
using L3 = std::tuple<void, int>;
|
||||
|
||||
BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_push_back<L3>, L3>));
|
||||
BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_push_back<L3, void>, L3>));
|
||||
BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_push_back<L3, int>, L3>));
|
||||
BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_push_back<L3, int, int, int, void, void, void>, L3>));
|
||||
|
||||
BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_push_back<L3, void const>, std::tuple<void, int, void const>>));
|
||||
BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_push_back<L3, int, char[], int, char[], void, char[], void, char[]>, std::tuple<void, int, char[]>>));
|
||||
}
|
||||
|
||||
{
|
||||
using L4 = std::tuple<void, int, char[]>;
|
||||
|
||||
BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_push_back<L4>, L4>));
|
||||
BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_push_back<L4, void>, L4>));
|
||||
BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_push_back<L4, int>, L4>));
|
||||
BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_push_back<L4, char[]>, L4>));
|
||||
BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_push_back<L4, void, int, char[], void, int, char[]>, L4>));
|
||||
|
||||
BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_push_back<L4, void const>, std::tuple<void, int, char[], void const>>));
|
||||
BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_push_back<L4, void const, int const, char const[]>, std::tuple<void, int, char[], void const, int const, char const[]>>));
|
||||
BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_push_back<L4, void, void const, int, int const, char[], char const[]>, std::tuple<void, int, char[], void const, int const, char const[]>>));
|
||||
}
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
124
test/mp_set_push_front.cpp
Normal file
124
test/mp_set_push_front.cpp
Normal file
@@ -0,0 +1,124 @@
|
||||
|
||||
// Copyright 2015 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 <boost/mp11/set.hpp>
|
||||
#include <boost/mp11/list.hpp>
|
||||
#include <boost/core/lightweight_test_trait.hpp>
|
||||
#include <type_traits>
|
||||
#include <tuple>
|
||||
|
||||
int main()
|
||||
{
|
||||
using boost::mp_list;
|
||||
using boost::mp_set_push_front;
|
||||
|
||||
{
|
||||
using L1 = mp_list<>;
|
||||
|
||||
BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_push_front<L1>, L1>));
|
||||
|
||||
BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_push_front<L1, void>, mp_list<void>>));
|
||||
BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_push_front<L1, int>, mp_list<int>>));
|
||||
BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_push_front<L1, void, int>, mp_list<void, int>>));
|
||||
BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_push_front<L1, void, int, char[]>, mp_list<void, int, char[]>>));
|
||||
BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_push_front<L1, void, int, void, int, void, int>, mp_list<void, int>>));
|
||||
}
|
||||
|
||||
{
|
||||
using L2 = mp_list<void>;
|
||||
|
||||
BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_push_front<L2>, L2>));
|
||||
BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_push_front<L2, void>, L2>));
|
||||
|
||||
BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_push_front<L2, int>, mp_list<int, void>>));
|
||||
BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_push_front<L2, void, int>, mp_list<int, void>>));
|
||||
BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_push_front<L2, void, void, void, int, int, int>, mp_list<int, void>>));
|
||||
}
|
||||
|
||||
{
|
||||
using L3 = mp_list<void, int>;
|
||||
|
||||
BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_push_front<L3>, L3>));
|
||||
BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_push_front<L3, void>, L3>));
|
||||
BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_push_front<L3, int>, L3>));
|
||||
BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_push_front<L3, int, int, int, void, void, void>, L3>));
|
||||
|
||||
BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_push_front<L3, void const>, mp_list<void const, void, int>>));
|
||||
BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_push_front<L3, void const, int const>, mp_list<void const, int const, void, int>>));
|
||||
BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_push_front<L3, int, char[], int, char[], void, char[], void, char[]>, mp_list<char[], void, int>>));
|
||||
}
|
||||
|
||||
{
|
||||
using L4 = mp_list<void, int, char[]>;
|
||||
|
||||
BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_push_front<L4>, L4>));
|
||||
BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_push_front<L4, void>, L4>));
|
||||
BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_push_front<L4, int>, L4>));
|
||||
BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_push_front<L4, char[]>, L4>));
|
||||
BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_push_front<L4, void, int, char[], void, int, char[]>, L4>));
|
||||
|
||||
BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_push_front<L4, void const>, mp_list<void const, void, int, char[]>>));
|
||||
BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_push_front<L4, void const, int const, char const[]>, mp_list<void const, int const, char const[], void, int, char[]>>));
|
||||
BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_push_front<L4, void, void const, int, int const, char[], char const[]>, mp_list<void const, int const, char const[], void, int, char[]>>));
|
||||
}
|
||||
|
||||
//
|
||||
|
||||
{
|
||||
using L1 = std::tuple<>;
|
||||
|
||||
BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_push_front<L1>, L1>));
|
||||
|
||||
BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_push_front<L1, void>, std::tuple<void>>));
|
||||
BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_push_front<L1, int>, std::tuple<int>>));
|
||||
BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_push_front<L1, void, int>, std::tuple<void, int>>));
|
||||
BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_push_front<L1, void, int, char[]>, std::tuple<void, int, char[]>>));
|
||||
BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_push_front<L1, void, int, void, int, void, int>, std::tuple<void, int>>));
|
||||
}
|
||||
|
||||
{
|
||||
using L2 = std::tuple<void>;
|
||||
|
||||
BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_push_front<L2>, L2>));
|
||||
BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_push_front<L2, void>, L2>));
|
||||
|
||||
BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_push_front<L2, int>, std::tuple<int, void>>));
|
||||
BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_push_front<L2, void, int>, std::tuple<int, void>>));
|
||||
BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_push_front<L2, void, void, void, int, int, int>, std::tuple<int, void>>));
|
||||
}
|
||||
|
||||
{
|
||||
using L3 = std::tuple<void, int>;
|
||||
|
||||
BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_push_front<L3>, L3>));
|
||||
BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_push_front<L3, void>, L3>));
|
||||
BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_push_front<L3, int>, L3>));
|
||||
BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_push_front<L3, int, int, int, void, void, void>, L3>));
|
||||
|
||||
BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_push_front<L3, void const>, std::tuple<void const, void, int>>));
|
||||
BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_push_front<L3, void const, int const>, std::tuple<void const, int const, void, int>>));
|
||||
BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_push_front<L3, int, char[], int, char[], void, char[], void, char[]>, std::tuple<char[], void, int>>));
|
||||
}
|
||||
|
||||
{
|
||||
using L4 = std::tuple<void, int, char[]>;
|
||||
|
||||
BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_push_front<L4>, L4>));
|
||||
BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_push_front<L4, void>, L4>));
|
||||
BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_push_front<L4, int>, L4>));
|
||||
BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_push_front<L4, char[]>, L4>));
|
||||
BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_push_front<L4, void, int, char[], void, int, char[]>, L4>));
|
||||
|
||||
BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_push_front<L4, void const>, std::tuple<void const, void, int, char[]>>));
|
||||
BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_push_front<L4, void const, int const, char const[]>, std::tuple<void const, int const, char const[], void, int, char[]>>));
|
||||
BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_push_front<L4, void, void const, int, int const, char[], char const[]>, std::tuple<void const, int const, char const[], void, int, char[]>>));
|
||||
}
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
Reference in New Issue
Block a user