]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/libs/typeof/test/function_ptr.cpp
update sources to v12.2.3
[ceph.git] / ceph / src / boost / libs / typeof / test / function_ptr.cpp
CommitLineData
7c673cae
FG
1// Copyright (C) 2006 Arkadiy Vertleyb
2// Use, modification and distribution is subject to the Boost Software
3// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt)
4
5#include "test.hpp"
6
7BOOST_STATIC_ASSERT(boost::type_of::test<double(*)()>::value);
8BOOST_STATIC_ASSERT(boost::type_of::test<double(*)(int, double, short, char*, bool, char, float, long, unsigned short)>::value);
9BOOST_STATIC_ASSERT(boost::type_of::test<void(*)()>::value);
10BOOST_STATIC_ASSERT(boost::type_of::test<void(*)(int, double, short, char*, bool, char, float, long, unsigned short)>::value);
b32b8144
FG
11BOOST_STATIC_ASSERT(boost::type_of::test<void(*)(...)>::value);
12BOOST_STATIC_ASSERT(boost::type_of::test<void(*)(int, double, short, char*, bool, char, float, long, unsigned short, ...)>::value);
7c673cae
FG
13
14// check that const gets stripped from function pointer
15
b32b8144
FG
16int foo1(double);
17int foo2(...);
18typedef int(*PTR1)(double);
19typedef int(*PTR2)(...);
20typedef const PTR1 CPTR1;
21typedef const PTR2 CPTR2;
22CPTR1 cptr1 = foo1;
23CPTR2 cptr2 = foo2;
7c673cae 24
b32b8144
FG
25BOOST_STATIC_ASSERT((boost::is_same<BOOST_TYPEOF(cptr1), PTR1>::value));
26BOOST_STATIC_ASSERT((boost::is_same<BOOST_TYPEOF(cptr2), PTR2>::value));