// 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 #include #include template struct Xi { }; template<> struct Xi { using type = void; }; template using X = typename Xi::type; template using add_pointer = T*; template using add_reference = T&; template using add_extents = T[]; using boost::mp11::mp_quote; using QX = mp_quote; using Q_add_pointer = mp_quote; int main() { using boost::mp11::mp_valid; using boost::mp11::mp_valid_q; using boost::mp11::mp_identity; BOOST_TEST_TRAIT_FALSE((mp_valid)); BOOST_TEST_TRAIT_TRUE((mp_valid)); BOOST_TEST_TRAIT_FALSE((mp_valid)); BOOST_TEST_TRAIT_FALSE((mp_valid)); BOOST_TEST_TRAIT_TRUE((mp_valid)); BOOST_TEST_TRAIT_FALSE((mp_valid)); BOOST_TEST_TRAIT_FALSE((mp_valid)); BOOST_TEST_TRAIT_FALSE((mp_valid)); BOOST_TEST_TRAIT_TRUE((mp_valid)); BOOST_TEST_TRAIT_FALSE((mp_valid)); BOOST_TEST_TRAIT_FALSE((mp_valid)); BOOST_TEST_TRAIT_FALSE((mp_valid_q)); BOOST_TEST_TRAIT_TRUE((mp_valid_q)); BOOST_TEST_TRAIT_FALSE((mp_valid_q)); BOOST_TEST_TRAIT_FALSE((mp_valid_q)); BOOST_TEST_TRAIT_FALSE((mp_valid)); BOOST_TEST_TRAIT_TRUE((mp_valid)); BOOST_TEST_TRAIT_TRUE((mp_valid)); #if !BOOST_MP11_WORKAROUND( BOOST_MP11_MSVC, <= 1800 ) // msvc-12.0 can form pointer to reference BOOST_TEST_TRAIT_FALSE((mp_valid)); #endif BOOST_TEST_TRAIT_FALSE((mp_valid)); BOOST_TEST_TRAIT_FALSE((mp_valid)); BOOST_TEST_TRAIT_TRUE((mp_valid)); BOOST_TEST_TRAIT_TRUE((mp_valid)); BOOST_TEST_TRAIT_FALSE((mp_valid)); BOOST_TEST_TRAIT_FALSE((mp_valid_q)); BOOST_TEST_TRAIT_TRUE((mp_valid_q)); BOOST_TEST_TRAIT_TRUE((mp_valid_q)); BOOST_TEST_TRAIT_FALSE((mp_valid_q)); #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)); #if !BOOST_MP11_WORKAROUND( BOOST_MP11_MSVC, <= 1800 ) // msvc-12.0 gives an internal error here BOOST_TEST_TRAIT_FALSE((mp_valid)); #endif BOOST_TEST_TRAIT_TRUE((mp_valid)); BOOST_TEST_TRAIT_FALSE((mp_valid)); #endif BOOST_TEST_TRAIT_FALSE((mp_valid)); BOOST_TEST_TRAIT_TRUE((mp_valid)); #if !BOOST_MP11_WORKAROUND( BOOST_MP11_MSVC, <= 1800 ) // msvc-12.0 can form arrays to void or int& BOOST_TEST_TRAIT_FALSE((mp_valid)); BOOST_TEST_TRAIT_FALSE((mp_valid)); #endif BOOST_TEST_TRAIT_FALSE((mp_valid)); return boost::report_errors(); }