diff --git a/result_of_test.cpp b/result_of_test.cpp new file mode 100644 index 0000000..a3034e0 --- /dev/null +++ b/result_of_test.cpp @@ -0,0 +1,34 @@ +#include +#include +#include +#include + +class int_result_type { typedef int result_type; }; + +class int_result_of +{ + template struct result_of { typedef int type; }; +}; + +class int_result_type_and_float_result_of +{ + typedef int result_type; + template struct result_of { typedef float type; }; +}; + +struct X {}; + +int main() +{ + using namespace boost; + + typedef int (*func_ptr)(float, double); + typedef int (X::*mem_func_ptr)(float); + + BOOST_STATIC_ASSERT((is_same::type, int>::value)); + BOOST_STATIC_ASSERT((is_same::type, int>::value)); + BOOST_STATIC_ASSERT((is_same::type, int>::value)); + BOOST_STATIC_ASSERT((is_same::type, int>::value)); + BOOST_STATIC_ASSERT((is_same::type, int>::value)); + return 0; +}