// // Copyright 2003 © The Trustees of Indiana University. All rights // reserved. // // See the file enable_if_LICENSE for licensing conditions. // // Authors: Jaakko Järvi (jajarvi@osl.iu.edu) // Jeremiah Willcock (jewillco@osl.iu.edu) // Andrew Lumsdaine (lums@osl.iu.edu) // #include #include #include #include using boost::enable_if; using boost::mpl::not_; using boost::is_arithmetic; namespace A { template typename enable_if, bool>::type arithmetic_object(T t) { return true; } } namespace B { template typename enable_if >, bool>::type arithmetic_object(T t) { return false; } } int test_main(int, char*[]) { using namespace A; using namespace B; BOOST_TEST(arithmetic_object(1)); BOOST_TEST(arithmetic_object(1.0)); BOOST_TEST(!arithmetic_object("1")); BOOST_TEST(!arithmetic_object(static_cast(0))); return 0; }