result_type.cpp
来自「Boost provides free peer-reviewed portab」· C++ 代码 · 共 64 行
CPP
64 行
// (C) Copyright Tobias Schwinger//// Use modification and distribution are subject to the boost Software License,// Version 1.0. (See http://www.boost.org/LICENSE_1_0.txt).//------------------------------------------------------------------------------#include <boost/mpl/assert.hpp>#include <boost/type_traits/is_same.hpp>#include <boost/function_types/result_type.hpp>namespace ft = boost::function_types;class C; typedef C func();typedef C (*func_ptr)();typedef C (&func_ref)();typedef C (C::*mem_func_ptr)();typedef C (C::*c_mem_func_ptr)() const;typedef C (C::*v_mem_func_ptr)() volatile;typedef C (C::*cv_mem_func_ptr)() const volatile;typedef int C::* mem_ptr;typedef int const C::* c_mem_ptr;BOOST_MPL_ASSERT(( boost::is_same<ft::result_type<func>::type,C>));BOOST_MPL_ASSERT(( boost::is_same<ft::result_type<func_ptr>::type,C>));BOOST_MPL_ASSERT(( boost::is_same<ft::result_type<func_ref>::type,C>));BOOST_MPL_ASSERT(( boost::is_same<ft::result_type<mem_func_ptr>::type,C>));BOOST_MPL_ASSERT(( boost::is_same<ft::result_type<c_mem_func_ptr>::type,C>));BOOST_MPL_ASSERT(( boost::is_same<ft::result_type<v_mem_func_ptr>::type,C>));BOOST_MPL_ASSERT(( boost::is_same<ft::result_type<cv_mem_func_ptr>::type,C>));BOOST_MPL_ASSERT(( boost::is_same<ft::result_type<mem_ptr>::type,int&>));BOOST_MPL_ASSERT(( boost::is_same<ft::result_type<c_mem_ptr>::type,int const&>));
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?