function_ptr.cpp
来自「Boost provides free peer-reviewed portab」· C++ 代码 · 共 20 行
CPP
20 行
// Copyright (C) 2006 Arkadiy Vertleyb// Use, modification and distribution is subject to the Boost Software// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt)#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 pointerint foo(double);typedef int(*PTR)(double);typedef const PTR CPTR;CPTR cptr = foo;BOOST_STATIC_ASSERT((boost::is_same<BOOST_TYPEOF(cptr), PTR>::value));
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?