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\typeof_impl.hpp
旋转
特效
属性
历史版本
// Copyright (C) 2004, 2005 Arkadiy Vertleyb // Copyright (C) 2005 Peder Holt // 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_TYPEOF_TYPEOF_IMPL_HPP_INCLUDED #define BOOST_TYPEOF_TYPEOF_IMPL_HPP_INCLUDED #include
#include
#include
#include
#include
#include
#define BOOST_TYPEOF_VECTOR(n) BOOST_PP_CAT(boost::type_of::vector, n) #define BOOST_TYPEOF_sizer_item(z, n, _)\ char item ## n[V::item ## n ::value]; namespace boost { namespace type_of { template
struct sizer { // char item0[V::item0::value]; // char item1[V::item1::value]; // ... BOOST_PP_REPEAT(BOOST_TYPEOF_LIMIT_SIZE, BOOST_TYPEOF_sizer_item, ~) }; }} #undef BOOST_TYPEOF_sizer_item // namespace boost { namespace type_of { # ifdef BOOST_NO_SFINAE template
sizer
::type> encode(const T&); # else template
typename enable_if< typename is_function
::type, sizer
::type> >::type encode(T&); template
typename disable_if< typename is_function
::type, sizer
::type> >::type encode(const T&); # endif }} // namespace boost { namespace type_of { template
struct decode_begin { typedef typename decode_type
::type type; }; }} #define BOOST_TYPEOF_TYPEITEM(z, n, expr)\ boost::mpl::size_t
>(expr).item ## n)> #define BOOST_TYPEOF_ENCODED_VECTOR(Expr) \ BOOST_TYPEOF_VECTOR(BOOST_TYPEOF_LIMIT_SIZE)< \ BOOST_PP_ENUM(BOOST_TYPEOF_LIMIT_SIZE, BOOST_TYPEOF_TYPEITEM, Expr) \ > #define BOOST_TYPEOF(Expr)\ boost::type_of::decode_begin
::type #define BOOST_TYPEOF_TPL typename BOOST_TYPEOF //offset_vector is used to delay the insertion of data into the vector in order to allow //encoding to be done in many steps namespace boost { namespace type_of { template
struct offset_vector { }; template
struct push_back
,T> { typedef offset_vector
type; }; template
struct push_back
>,T> { typedef typename push_back
::type type; }; }} #define BOOST_TYPEOF_NESTED_TYPEITEM(z, n, expr)\ BOOST_STATIC_CONSTANT(int,BOOST_PP_CAT(value,n) = sizeof(boost::type_of::encode<_typeof_start_vector>(expr).item ## n));\ typedef boost::mpl::size_t
BOOST_PP_CAT(item,n); #ifdef __DMC__ #define BOOST_TYPEOF_NESTED_TYPEITEM_2(z,n,expr)\ typedef typename _typeof_encode_fraction
::BOOST_PP_CAT(item,n) BOOST_PP_CAT(item,n); #define BOOST_TYPEOF_FRACTIONTYPE()\ BOOST_PP_REPEAT(BOOST_TYPEOF_LIMIT_SIZE,BOOST_TYPEOF_NESTED_TYPEITEM_2,_)\ typedef _typeof_fraction_iter
fraction_type; #else #define BOOST_TYPEOF_FRACTIONTYPE()\ typedef _typeof_encode_fraction
fraction_type; #endif #ifdef __BORLANDC__ namespace boost { namespace type_of { template
struct generic_typeof_fraction_iter { typedef generic_typeof_fraction_iter
self_t; static const int pos=(Pos::value); static const int iteration=(pos/5); static const int where=pos%5; typedef typename Iter::template _apply_next
::type fraction_type; typedef generic_typeof_fraction_iter
next; typedef typename v_iter
>::type type; }; }} #define BOOST_TYPEOF_NESTED_TYPEDEF_IMPL(expr) \ template
\ struct _typeof_encode_fraction {\ typedef _typeof_encode_fraction<_Typeof_Iteration> self_t;\ BOOST_STATIC_CONSTANT(int,_typeof_encode_offset = (_Typeof_Iteration*BOOST_TYPEOF_LIMIT_SIZE));\ typedef boost::type_of::offset_vector
,boost::mpl::size_t
> _typeof_start_vector;\ BOOST_PP_REPEAT(BOOST_TYPEOF_LIMIT_SIZE,BOOST_TYPEOF_NESTED_TYPEITEM,expr)\ template
\ struct _apply_next {\ typedef _typeof_encode_fraction
type;\ };\ };\ template
\ struct _typeof_fraction_iter {\ typedef boost::type_of::generic_typeof_fraction_iter
> self_t;\ typedef typename self_t::next next;\ typedef typename self_t::type type;\ }; #else #define BOOST_TYPEOF_NESTED_TYPEDEF_IMPL(expr) \ template
\ struct _typeof_encode_fraction {\ typedef _typeof_encode_fraction<_Typeof_Iteration> self_t;\ BOOST_STATIC_CONSTANT(int,_typeof_encode_offset = (_Typeof_Iteration*BOOST_TYPEOF_LIMIT_SIZE));\ typedef boost::type_of::offset_vector
,boost::mpl::size_t
> _typeof_start_vector;\ BOOST_PP_REPEAT(BOOST_TYPEOF_LIMIT_SIZE,BOOST_TYPEOF_NESTED_TYPEITEM,expr)\ };\ template
\ struct _typeof_fraction_iter {\ typedef _typeof_fraction_iter
self_t;\ BOOST_STATIC_CONSTANT(int,pos=(Pos::value));\ BOOST_STATIC_CONSTANT(int,iteration=(pos/BOOST_TYPEOF_LIMIT_SIZE));\ BOOST_STATIC_CONSTANT(int,where=pos%BOOST_TYPEOF_LIMIT_SIZE);\ BOOST_TYPEOF_FRACTIONTYPE()\ typedef typename boost::type_of::v_iter
>::type type;\ typedef _typeof_fraction_iter
next;\ }; #endif #ifdef __MWERKS__ # define BOOST_TYPEOF_NESTED_TYPEDEF(name,expr) \ template
\ struct BOOST_PP_CAT(_typeof_template_,name) {\ BOOST_TYPEOF_NESTED_TYPEDEF_IMPL(expr)\ typedef typename boost::type_of::decode_type<_typeof_fraction_iter
> >::type type;\ };\ typedef BOOST_PP_CAT(_typeof_template_,name)
name; # define BOOST_TYPEOF_NESTED_TYPEDEF_TPL(name,expr) BOOST_TYPEOF_NESTED_TYPEDEF(name,expr) #else # define BOOST_TYPEOF_NESTED_TYPEDEF_TPL(name,expr) \ struct name {\ BOOST_TYPEOF_NESTED_TYPEDEF_IMPL(expr)\ typedef typename boost::type_of::decode_type<_typeof_fraction_iter
> >::type type;\ }; # define BOOST_TYPEOF_NESTED_TYPEDEF(name,expr) \ struct name {\ BOOST_TYPEOF_NESTED_TYPEDEF_IMPL(expr)\ typedef boost::type_of::decode_type<_typeof_fraction_iter
> >::type type;\ }; #endif #endif//BOOST_TYPEOF_COMPLIANT_TYPEOF_IMPL_HPP_INCLUDED
typeof_impl.hpp
网页地址
文件地址
上一页
19/24
下一页
下载
( 7 KB )
Comments
Total ratings:
0
Average rating:
无评论
of 10
Would you like to comment?
Join now
, or
Logon
if you are already a member.