diff --git a/tests/function_traits_test.cpp b/tests/function_traits_test.cpp new file mode 100644 index 0000000..0c4655e --- /dev/null +++ b/tests/function_traits_test.cpp @@ -0,0 +1,58 @@ +// (C) Copyright Doug Gregor 2002. Permission to copy, use, modify, sell and +// distribute this software is granted provided this copyright notice appears +// in all copies. This software is provided "as is" without express or implied +// warranty, and with no claim as to its suitability for any purpose. + +#include +#define BOOST_INCLUDE_MAIN +#include + +template +struct is_int +{ + BOOST_STATIC_CONSTANT(bool, value = false); +}; + +template<> +struct is_int +{ + BOOST_STATIC_CONSTANT(bool, value = true); +}; + +template +struct is_float +{ + BOOST_STATIC_CONSTANT(bool, value = false); +}; + +template<> +struct is_float +{ + BOOST_STATIC_CONSTANT(bool, value = true); +}; +template +struct is_double +{ + BOOST_STATIC_CONSTANT(bool, value = false); +}; + +template<> +struct is_double +{ + BOOST_STATIC_CONSTANT(bool, value = true); +}; + + +int test_main(int, char*[]) +{ +#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION + typedef int F2(float, double); + + typedef boost::function_traits traits; + + BOOST_TEST(is_int::value); + BOOST_TEST(is_float::value); + BOOST_TEST(is_double::value); +#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION + return 0; +}