forked from boostorg/mp11
Add a few more mp_defer tests
This commit is contained in:
@@ -31,6 +31,11 @@ using boost::mp11::mp_defer;
|
|||||||
template<class T> using add_pointer = T*;
|
template<class T> using add_pointer = T*;
|
||||||
template<class... T> using add_pointer_impl = mp_defer<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()
|
int main()
|
||||||
{
|
{
|
||||||
BOOST_TEST_TRAIT_TRUE((has_type<add_pointer_impl<void>>));
|
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<>>));
|
||||||
BOOST_TEST_TRAIT_FALSE((has_type<add_pointer_impl<void, void>>));
|
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();
|
return boost::report_errors();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user