From 11b18afccee123061ef7f79350e85379941de205 Mon Sep 17 00:00:00 2001 From: Arkadiy Vertleyb Date: Mon, 5 Jun 2006 02:43:08 +0000 Subject: [PATCH] merged function binding [SVN r34176] --- test/function_ptr.cpp | 9 +++++++++ test/function_ref.cpp | 8 ++++++++ test/nested_typedef.cpp | 2 +- 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/test/function_ptr.cpp b/test/function_ptr.cpp index 2e08a15..be08c11 100755 --- a/test/function_ptr.cpp +++ b/test/function_ptr.cpp @@ -4,3 +4,12 @@ BOOST_STATIC_ASSERT(boost::type_of::test::value); BOOST_STATIC_ASSERT(boost::type_of::test::value); BOOST_STATIC_ASSERT(boost::type_of::test::value); BOOST_STATIC_ASSERT(boost::type_of::test::value); + +// check that const gets stripped from function pointer + +int foo(double); +typedef int(*PTR)(double); +typedef const PTR CPTR; +CPTR cptr = foo; + +BOOST_STATIC_ASSERT((boost::is_same::value)); diff --git a/test/function_ref.cpp b/test/function_ref.cpp index bc9f6ec..560ef53 100755 --- a/test/function_ref.cpp +++ b/test/function_ref.cpp @@ -2,3 +2,11 @@ BOOST_STATIC_ASSERT(boost::type_of::test::value); BOOST_STATIC_ASSERT(boost::type_of::test::value); + +// check that function values/refs can be bound + +int foo(double); +typedef int(&FREF)(double); +FREF fref = *foo; + +BOOST_STATIC_ASSERT((boost::is_same::value)); diff --git a/test/nested_typedef.cpp b/test/nested_typedef.cpp index d1bb3e4..129307e 100644 --- a/test/nested_typedef.cpp +++ b/test/nested_typedef.cpp @@ -8,7 +8,7 @@ void do_int(int) {} struct { template - T operator[](const T&) {} + T operator[](const T& n) {return n;} } int_p;