1
0
forked from boostorg/mp11

Add a few more mp_defer tests

This commit is contained in:
Peter Dimov
2017-12-21 21:35:39 +02:00
parent 96dc3c5c20
commit 4c8d36d071

View File

@@ -31,6 +31,11 @@ using boost::mp11::mp_defer;
template<class T> using add_pointer = T*;
template<class... T> using add_pointer_impl = mp_defer<add_pointer, T...>;
using boost::mp11::mp_quote;
using Q_add_pointer = mp_quote<add_pointer>;
template<class... T> using Q_add_pointer_impl = mp_defer<Q_add_pointer::fn, T...>;
int main()
{
BOOST_TEST_TRAIT_TRUE((has_type<add_pointer_impl<void>>));
@@ -42,5 +47,18 @@ int main()
BOOST_TEST_TRAIT_FALSE((has_type<add_pointer_impl<>>));
BOOST_TEST_TRAIT_FALSE((has_type<add_pointer_impl<void, void>>));
#if !BOOST_WORKAROUND( BOOST_MSVC, <= 1800 )
BOOST_TEST_TRAIT_TRUE((has_type<Q_add_pointer_impl<void>>));
#endif
BOOST_TEST_TRAIT_TRUE((std::is_same<Q_add_pointer_impl<void>::type, void*>));
#if !BOOST_WORKAROUND( BOOST_MSVC, <= 1800 )
BOOST_TEST_TRAIT_TRUE((has_type<Q_add_pointer_impl<int>>));
#endif
BOOST_TEST_TRAIT_TRUE((std::is_same<Q_add_pointer_impl<int>::type, int*>));
BOOST_TEST_TRAIT_FALSE((has_type<Q_add_pointer_impl<>>));
BOOST_TEST_TRAIT_FALSE((has_type<Q_add_pointer_impl<void, void>>));
return boost::report_errors();
}