From 532c8aa06da4b5ccbe33b49ca8c98ed9b6ef07ff Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Sun, 2 May 2004 14:49:44 +0000 Subject: [PATCH] boost/result_of.hpp, boost/detail/result_of_iterate.hpp: - Deal with function references - Deal with cv-qualified member pointers libs/utility/result_of_test.cpp: - Test all of those things above [SVN r2157] --- result_of_test.cpp | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/result_of_test.cpp b/result_of_test.cpp index cea59ee..5dd3df6 100644 --- a/result_of_test.cpp +++ b/result_of_test.cpp @@ -3,14 +3,14 @@ #include #include -class int_result_type { typedef int result_type; }; +struct int_result_type { typedef int result_type; }; -class int_result_of +struct int_result_of { template struct result { typedef int type; }; }; -class int_result_type_and_float_result_of +struct int_result_type_and_float_result_of { typedef int result_type; template struct result { typedef float type; }; @@ -23,13 +23,23 @@ int main() using namespace boost; typedef int (*func_ptr)(float, double); + typedef int (&func_ref)(float, double); typedef int (X::*mem_func_ptr)(float); + typedef int (X::*mem_func_ptr_c)(float) const; + typedef int (X::*mem_func_ptr_v)(float) volatile; + typedef int (X::*mem_func_ptr_cv)(float) const volatile; BOOST_STATIC_ASSERT((is_same::type, int>::value)); BOOST_STATIC_ASSERT((is_same::type, int>::value)); BOOST_STATIC_ASSERT((is_same::type, void>::value)); + BOOST_STATIC_ASSERT((is_same::type, int>::value)); + BOOST_STATIC_ASSERT((is_same::type, void>::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)); + 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; }