mirror of
https://github.com/boostorg/typeof.git
synced 2025-07-29 20:37:28 +02:00
merged function binding
[SVN r34176]
This commit is contained in:
@ -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));
|
||||
|
@ -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));
|
||||
|
@ -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;
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user