Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r49980 - trunk/libs/function_types/test/decomposition
From: tschwinger_at_[hidden]
Date: 2008-11-28 06:38:39


Author: t_schwinger
Date: 2008-11-28 06:38:38 EST (Fri, 28 Nov 2008)
New Revision: 49980
URL: http://svn.boost.org/trac/boost/changeset/49980

Log:
adds tests with const result

Text files modified:
   trunk/libs/function_types/test/decomposition/result_type.cpp | 47 ++++++++++++++++++++++++++++++++++-----
   1 files changed, 41 insertions(+), 6 deletions(-)

Modified: trunk/libs/function_types/test/decomposition/result_type.cpp
==============================================================================
--- trunk/libs/function_types/test/decomposition/result_type.cpp (original)
+++ trunk/libs/function_types/test/decomposition/result_type.cpp 2008-11-28 06:38:38 EST (Fri, 28 Nov 2008)
@@ -16,12 +16,19 @@
 
 class C;
 typedef C func();
+typedef C const c_func();
 typedef C (*func_ptr)();
+typedef C const (*c_func_ptr)();
 typedef C (&func_ref)();
+typedef C const (&c_func_ref)();
 typedef C (C::*mem_func_ptr)();
-typedef C (C::*c_mem_func_ptr)() const;
-typedef C (C::*v_mem_func_ptr)() volatile;
-typedef C (C::*cv_mem_func_ptr)() const volatile;
+typedef C const (C::*c_mem_func_ptr)();
+typedef C (C::*mem_func_ptr_c)() const;
+typedef C const (C::*c_mem_func_ptr_c)() const;
+typedef C (C::*mem_func_ptr_v)() volatile;
+typedef C const (C::*c_mem_func_ptr_v)() volatile;
+typedef C (C::*mem_func_ptr_cv)() const volatile;
+typedef C const (C::*c_mem_func_ptr_cv)() const volatile;
 typedef int C::* mem_ptr;
 typedef int const C::* c_mem_ptr;
 
@@ -30,27 +37,55 @@
 ));
 
 BOOST_MPL_ASSERT((
+ boost::is_same<ft::result_type<c_func>::type,C const>
+));
+
+BOOST_MPL_ASSERT((
   boost::is_same<ft::result_type<func_ptr>::type,C>
 ));
 
 BOOST_MPL_ASSERT((
+ boost::is_same<ft::result_type<c_func_ptr>::type,C const>
+));
+
+BOOST_MPL_ASSERT((
   boost::is_same<ft::result_type<func_ref>::type,C>
 ));
 
 BOOST_MPL_ASSERT((
+ boost::is_same<ft::result_type<c_func_ref>::type,C const>
+));
+
+BOOST_MPL_ASSERT((
   boost::is_same<ft::result_type<mem_func_ptr>::type,C>
 ));
 
 BOOST_MPL_ASSERT((
- boost::is_same<ft::result_type<c_mem_func_ptr>::type,C>
+ boost::is_same<ft::result_type<c_mem_func_ptr>::type,C const>
+));
+
+BOOST_MPL_ASSERT((
+ boost::is_same<ft::result_type<mem_func_ptr_c>::type,C>
+));
+
+BOOST_MPL_ASSERT((
+ boost::is_same<ft::result_type<c_mem_func_ptr_c>::type,C const>
+));
+
+BOOST_MPL_ASSERT((
+ boost::is_same<ft::result_type<mem_func_ptr_v>::type,C>
+));
+
+BOOST_MPL_ASSERT((
+ boost::is_same<ft::result_type<c_mem_func_ptr_v>::type,C const>
 ));
 
 BOOST_MPL_ASSERT((
- boost::is_same<ft::result_type<v_mem_func_ptr>::type,C>
+ boost::is_same<ft::result_type<mem_func_ptr_cv>::type,C>
 ));
 
 BOOST_MPL_ASSERT((
- boost::is_same<ft::result_type<cv_mem_func_ptr>::type,C>
+ boost::is_same<ft::result_type<c_mem_func_ptr_cv>::type,C const>
 ));
 
 BOOST_MPL_ASSERT((


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk