x
Yes
No
Do you want to visit DriveHQ English website?
首页
产品服务
价格
免费试用
下载客户端
关于我们
云文件服务
|
云备份服务
|
FTP服务
|
企业邮箱服务
|
网站托管
|
客户端软件
云文件服务
云备份服务
FTP服务
企业级邮箱服务
网站托管
客户端软件
typeof_impl.hpp - Hosted on DriveHQ Cloud IT Platform
返回上层目录
上传
下载
共享
发布
新建文件夹
新建文件
复制
剪切
删除
粘贴
评论
升级服务
路径: \\game3dprogramming\materials\GameFactory\GameFactoryDemo\references\boost_1_35_0\boost\typeof\dmc\typeof_impl.hpp
旋转
特效
属性
历史版本
// Copyright (C) 2007 Peder Holt // Use, modification and distribution is subject to the Boost Software // License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) #ifndef BOOST_TYPEOF_MSVC_TYPEOF_IMPL_HPP_INCLUDED # define BOOST_TYPEOF_MSVC_TYPEOF_IMPL_HPP_INCLUDED # include
# include
# include
namespace boost { namespace type_of { template
struct encode_counter : encode_counter
{}; template<> struct encode_counter<0> {}; char (*encode_index(...))[1]; # define BOOST_TYPEOF_INDEX(T) (sizeof(*boost::type_of::encode_index((boost::type_of::encode_counter<1000>*)0))) # define BOOST_TYPEOF_NEXT_INDEX(next) friend char (*encode_index(encode_counter
*))[next]; //Typeof code template
struct msvc_extract_type { struct id2type; }; template
struct msvc_register_type : msvc_extract_type
{ typedef msvc_extract_type
base_type; struct base_type::id2type // This uses nice VC6.5 and VC7.1 bugfeature, also works for Digital Mars { typedef T type; }; }; template
struct msvc_typeid_wrapper { typedef typename msvc_extract_type
>::id2type id2type; typedef typename id2type::type type; }; //Tie it all together template
struct encode_type { //Get the next available compile time constants index BOOST_STATIC_CONSTANT(unsigned,value=BOOST_TYPEOF_INDEX(T)); //Instantiate the template typedef typename msvc_register_type
>::id2type type; //Set the next compile time constants index BOOST_STATIC_CONSTANT(unsigned,next=value+1); //Increment the compile time constant (only needed when extensions are not active BOOST_TYPEOF_NEXT_INDEX(next); }; template
struct sizer { typedef char(*type)[encode_type
::value]; }; template
typename sizer
::type encode_start(T const&); template
msvc_register_type
typeof_register_type(const T&,Organizer* =0); # define BOOST_TYPEOF(expr) \ boost::type_of::msvc_typeid_wrapper
::type # define BOOST_TYPEOF_TPL(expr) typename BOOST_TYPEOF(expr) # define BOOST_TYPEOF_NESTED_TYPEDEF_TPL(name,expr) \ struct name {\ BOOST_STATIC_CONSTANT(int,_typeof_register_value=sizeof(boost::type_of::typeof_register_type
(expr)));\ typedef typename boost::type_of::msvc_extract_type
::id2type id2type;\ typedef typename id2type::type type;\ }; # define BOOST_TYPEOF_NESTED_TYPEDEF(name,expr) \ struct name {\ BOOST_STATIC_CONSTANT(int,_typeof_register_value=sizeof(boost::type_of::typeof_register_type
(expr)));\ typedef boost::type_of::msvc_extract_type
::id2type id2type;\ typedef id2type::type type;\ }; } } #endif//BOOST_TYPEOF_MSVC_TYPEOF_IMPL_HPP_INCLUDED
typeof_impl.hpp
网页地址
文件地址
上一页 1/1 下一页
下载
( 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.