merged function binding

[SVN r34176]
This commit is contained in:
Arkadiy Vertleyb
2006-06-05 02:43:08 +00:00
parent 7cbdf2406a
commit 11b18afcce
3 changed files with 18 additions and 1 deletions

View File

@ -4,3 +4,12 @@ BOOST_STATIC_ASSERT(boost::type_of::test<double(*)()>::value);
BOOST_STATIC_ASSERT(boost::type_of::test<double(*)(int, double, short, char*, bool, char, float, long, unsigned short)>::value);
BOOST_STATIC_ASSERT(boost::type_of::test<void(*)()>::value);
BOOST_STATIC_ASSERT(boost::type_of::test<void(*)(int, double, short, char*, bool, char, float, long, unsigned short)>::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<BOOST_TYPEOF(cptr), PTR>::value));

View File

@ -2,3 +2,11 @@
BOOST_STATIC_ASSERT(boost::type_of::test<void(&)()>::value);
BOOST_STATIC_ASSERT(boost::type_of::test<int(&)(int, short)>::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<BOOST_TYPEOF(fref), int(double)>::value));

View File

@ -8,7 +8,7 @@ void do_int(int) {}
struct {
template<typename T>
T operator[](const T&) {}
T operator[](const T& n) {return n;}
} int_p;