x
Yes
No
Do you want to visit DriveHQ English website?
首页
产品服务
价格
免费试用
下载客户端
关于我们
云文件服务
|
云备份服务
|
FTP服务
|
企业邮箱服务
|
网站托管
|
客户端软件
云文件服务
云备份服务
FTP服务
企业级邮箱服务
网站托管
客户端软件
parenthesized_type.hpp - Hosted on DriveHQ Cloud IT Platform
返回上层目录
上传
下载
共享
发布
新建文件夹
新建文件
复制
剪切
删除
粘贴
评论
升级服务
路径: \\game3dprogramming\materials\GameFactory\GameFactoryDemo\references\boost_1_35_0\boost\parameter\aux_\parenthesized_type.hpp
旋转
特效
属性
历史版本
// Copyright David Abrahams 2006. Distributed under the Boost // Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #ifndef BOOST_PARAMETER_AUX_PARENTHESIZED_TYPE_DWA2006414_HPP # define BOOST_PARAMETER_AUX_PARENTHESIZED_TYPE_DWA2006414_HPP # include
# include
namespace boost { namespace parameter { namespace aux { // A macro that takes a parenthesized C++ type name (T) and transforms // it into an un-parenthesized type expression equivalent to T. # define BOOST_PARAMETER_PARENTHESIZED_TYPE(x) \ boost::parameter::aux::unaryfunptr_arg_type< void(*)x >::type // A metafunction that transforms void(*)(T) -> T template
struct unaryfunptr_arg_type; # if !BOOST_WORKAROUND(BOOST_MSVC, <= 1300) template
struct unaryfunptr_arg_type
{ typedef Arg type; }; # else // Use the "native typeof" bugfeatures of older versions of MSVC to // accomplish what we'd normally do with partial specialization. This // capability was discovered by Igor Chesnokov. # if BOOST_WORKAROUND(BOOST_MSVC, != 1300) // This version applies to VC6.5 and VC7.1 (except that we can just // use partial specialization for the latter in this case). // This gets used as a base class. template
struct msvc_type_memory { // A nullary metafunction that will yield the Value type "stored" // at this Address. struct storage; }; template
struct msvc_store_type : msvc_type_memory
{ // VC++ somehow lets us define the base's nested storage // metafunction here, where we have the Value type we'd like to // "store" in it. Later we can come back to the base class and // extract the "stored type." typedef msvc_type_memory
location; struct location::storage { typedef Value type; }; }; # else // This slightly more complicated version of the same thing is // required for msvc-7.0 template
struct msvc_type_memory { template
struct storage_impl; typedef storage_impl
storage; }; template
struct msvc_store_type : msvc_type_memory
{ // Rather than supplying a definition for the base class' nested // class, we specialize the base class' nested template template<> struct storage_impl
{ typedef Value type; }; }; # endif // Function template argument deduction does many of the same things // as type matching during partial specialization, so we call a // function template to "store" T into the type memory addressed by // void(*)(T). template
msvc_store_type
msvc_store_argument_type(void(*)(T)); template
struct unaryfunptr_arg_type { // We don't want the function to be evaluated, just instantiated, // so protect it inside of sizeof. enum { dummy = sizeof(msvc_store_argument_type((FunctionPointer)0)) }; // Now pull the type out of the instantiated base class typedef typename msvc_type_memory
::storage::type type; }; # endif template <> struct unaryfunptr_arg_type
{ typedef void type; }; }}} // namespace boost::parameter::aux #endif // BOOST_PARAMETER_AUX_PARENTHESIZED_TYPE_DWA2006414_HPP
parenthesized_type.hpp
网页地址
文件地址
上一页
7/15
下一页
下载
( 3 KB )
Comments
Total ratings:
0
Average rating:
无评论
of 10
Would you like to comment?
Join now
, or
Logon
if you are already a member.