forked from boostorg/mp11
Add mp_valid_q
This commit is contained in:
@@ -92,6 +92,8 @@ template<template<class...> class F, class... T> using mp_valid = typename detai
|
||||
|
||||
#endif
|
||||
|
||||
template<class Q, class... T> using mp_valid_q = mp_valid<Q::template fn, T...>;
|
||||
|
||||
// mp_defer
|
||||
namespace detail
|
||||
{
|
||||
|
@@ -34,6 +34,7 @@ using Q_add_pointer = mp_quote<add_pointer>;
|
||||
int main()
|
||||
{
|
||||
using boost::mp11::mp_valid;
|
||||
using boost::mp11::mp_valid_q;
|
||||
using boost::mp11::mp_identity;
|
||||
|
||||
BOOST_TEST_TRAIT_FALSE((mp_valid<mp_identity>));
|
||||
@@ -50,6 +51,11 @@ int main()
|
||||
BOOST_TEST_TRAIT_FALSE((mp_valid<QX::fn, int>));
|
||||
BOOST_TEST_TRAIT_FALSE((mp_valid<QX::fn, void, void>));
|
||||
|
||||
BOOST_TEST_TRAIT_FALSE((mp_valid_q<QX>));
|
||||
BOOST_TEST_TRAIT_TRUE((mp_valid_q<QX, void>));
|
||||
BOOST_TEST_TRAIT_FALSE((mp_valid_q<QX, int>));
|
||||
BOOST_TEST_TRAIT_FALSE((mp_valid_q<QX, void, void>));
|
||||
|
||||
BOOST_TEST_TRAIT_FALSE((mp_valid<add_pointer>));
|
||||
BOOST_TEST_TRAIT_TRUE((mp_valid<add_pointer, void>));
|
||||
BOOST_TEST_TRAIT_TRUE((mp_valid<add_pointer, int>));
|
||||
@@ -64,6 +70,11 @@ int main()
|
||||
BOOST_TEST_TRAIT_TRUE((mp_valid<Q_add_pointer::fn, int>));
|
||||
BOOST_TEST_TRAIT_FALSE((mp_valid<Q_add_pointer::fn, void, void>));
|
||||
|
||||
BOOST_TEST_TRAIT_FALSE((mp_valid_q<Q_add_pointer>));
|
||||
BOOST_TEST_TRAIT_TRUE((mp_valid_q<Q_add_pointer, void>));
|
||||
BOOST_TEST_TRAIT_TRUE((mp_valid_q<Q_add_pointer, int>));
|
||||
BOOST_TEST_TRAIT_FALSE((mp_valid_q<Q_add_pointer, void, void>));
|
||||
|
||||
#if !BOOST_MP11_WORKAROUND( BOOST_MP11_GCC, < 70000 )
|
||||
// g++ up to at least 6.3 doesn't like add_reference for some reason or other
|
||||
BOOST_TEST_TRAIT_FALSE((mp_valid<add_reference>));
|
||||
|
Reference in New Issue
Block a user