2
0
mirror of https://github.com/boostorg/typeof.git synced 2026-01-23 06:02:16 +00:00
Files
typeof/test/function_ptr.cpp
Arkadiy Vertleyb a8112fe31d function binding
[SVN r34175]
2006-06-05 02:32:41 +00:00

16 lines
616 B
C++
Executable File

#include "test.hpp"
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));