1 2 // Copyright 2019 Peter Dimov. 3 // 4 // Distributed under the Boost Software License, Version 1.0. 5 // 6 // See accompanying file LICENSE_1_0.txt or copy at 7 // http://www.boost.org/LICENSE_1_0.txt 8 9 10 #include <boost/mp11/utility.hpp> 11 #include <boost/core/lightweight_test_trait.hpp> 12 #include <type_traits> 13 14 template<class T> using is_const_ = std::is_const<T>; 15 16 struct Q_is_const 17 { 18 template<class T> using fn = std::is_const<T>; 19 }; 20 main()21int main() 22 { 23 using boost::mp11::mp_not_fn; 24 using boost::mp11::mp_not_fn_q; 25 26 BOOST_TEST_TRAIT_TRUE((mp_not_fn<std::is_const>::fn<void>)); 27 BOOST_TEST_TRAIT_FALSE((mp_not_fn<std::is_const>::fn<void const>)); 28 29 BOOST_TEST_TRAIT_TRUE((mp_not_fn<is_const_>::fn<void>)); 30 BOOST_TEST_TRAIT_FALSE((mp_not_fn<is_const_>::fn<void const>)); 31 32 BOOST_TEST_TRAIT_TRUE((mp_not_fn_q<Q_is_const>::fn<void>)); 33 BOOST_TEST_TRAIT_FALSE((mp_not_fn_q<Q_is_const>::fn<void const>)); 34 35 return boost::report_errors(); 36 } 37