// // 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 using boost::enable_if; using boost::disable_if; using boost::is_arithmetic; struct container { template typename enable_if, bool>::type arithmetic_object(const T&, const int* /* disambiguate */ = 0) {return true;} template typename disable_if, bool>::type arithmetic_object(const T&) {return false;} }; int test_main(int, char*[]) { BOOST_TEST(container().arithmetic_object(1)); BOOST_TEST(container().arithmetic_object(1.0)); BOOST_TEST(!container().arithmetic_object("1")); BOOST_TEST(!container().arithmetic_object(static_cast(0))); return 0; }