// // 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::is_arithmetic; template struct dummy { dummy(int) {}; }; template typename enable_if::value, bool>::type arithmetic_object(T t, dummy<0> = 0) { return true; } template typename enable_if::value, bool>::type arithmetic_object(T t, dummy<1> = 0) { return false; } int test_main(int, char*[]) { 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; }