/* Copyright 2021 Glen Joseph Fernandes (glenjofe@gmail.com) Distributed under the Boost Software License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) */ #include #include template struct valid { typedef void type; }; template struct has_pointer { static const bool value = false; }; template struct has_pointer::type> { static const bool value = true; }; template struct has_element_type { static const bool value = false; }; template struct has_element_type::type> { static const bool value = true; }; template struct has_difference_type { static const bool value = false; }; template struct has_difference_type::type> { static const bool value = true; }; template struct has_rebind_to_type { static const bool value = false; }; template struct has_rebind_to_type::type>::type> { static const bool value = true; }; struct P1 { }; struct P2 { typedef int element_type; }; struct P3 { typedef int element_type; #if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES) template using rebind = P3; #else template struct rebind { typedef P3 other; }; #endif }; template struct S { typedef T element_type; }; typedef S P4; int main() { BOOST_TEST(!has_pointer >::value); BOOST_TEST(!has_element_type >::value); BOOST_TEST(!has_difference_type >::value); BOOST_TEST((!has_rebind_to_type, char>::value)); BOOST_TEST(has_pointer >::value); BOOST_TEST(has_element_type >::value); BOOST_TEST(has_difference_type >::value); BOOST_TEST((!has_rebind_to_type, char>::value)); BOOST_TEST(has_pointer >::value); BOOST_TEST(has_element_type >::value); BOOST_TEST(has_difference_type >::value); BOOST_TEST((has_rebind_to_type, char>::value)); BOOST_TEST(has_pointer >::value); BOOST_TEST(has_element_type >::value); BOOST_TEST(has_difference_type >::value); BOOST_TEST((has_rebind_to_type, char>::value)); BOOST_TEST(has_pointer >::value); BOOST_TEST(has_element_type >::value); BOOST_TEST(has_difference_type >::value); BOOST_TEST((has_rebind_to_type, char>::value)); return boost::report_errors(); }