x
Yes
No
Do you want to visit DriveHQ English website?
首页
产品服务
价格
免费试用
下载客户端
关于我们
云文件服务
|
云备份服务
|
FTP服务
|
企业邮箱服务
|
网站托管
|
客户端软件
云文件服务
云备份服务
FTP服务
企业级邮箱服务
网站托管
客户端软件
in_place_factory.hpp - Hosted on DriveHQ Cloud IT Platform
返回上层目录
上传
下载
共享
发布
新建文件夹
新建文件
复制
剪切
删除
粘贴
评论
升级服务
路径: \\game3dprogramming\materials\GameFactory\GameFactoryDemo\references\boost_1_35_0\boost\utility\in_place_factory.hpp
旋转
特效
属性
历史版本
// Copyright (C) 2003, Fernando Luis Cacciola Carballal. // Copyright (C) 2007, Tobias Schwinger. // // Use, modification, and distribution is subject to 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) // // See http://www.boost.org/lib/optional for documentation. // // You are welcome to contact the author at: // fernando_cacciola@hotmail.com // #ifndef BOOST_UTILITY_INPLACE_FACTORY_04APR2007_HPP #ifndef BOOST_PP_IS_ITERATING #include
namespace boost { class in_place_factory_base {} ; #define BOOST_PP_ITERATION_LIMITS (0, BOOST_MAX_INPLACE_FACTORY_ARITY) #define BOOST_PP_FILENAME_1
#include BOOST_PP_ITERATE() } // namespace boost #include
#define BOOST_UTILITY_INPLACE_FACTORY_04APR2007_HPP #else #define N BOOST_PP_ITERATION() #if N template< BOOST_PP_ENUM_PARAMS(N, class A) > #endif class BOOST_PP_CAT(in_place_factory,N) : public in_place_factory_base { public: explicit BOOST_PP_CAT(in_place_factory,N) ( BOOST_PP_ENUM_BINARY_PARAMS(N,A,const& a) ) #if N > 0 : BOOST_PP_ENUM(N, BOOST_DEFINE_INPLACE_FACTORY_CLASS_MEMBER_INIT, _) #endif {} template
void* apply(void* address BOOST_APPEND_EXPLICIT_TEMPLATE_TYPE(T)) const { return new(address) T( BOOST_PP_ENUM_PARAMS(N, m_a) ); } template
void* apply(void* address, std::size_t n BOOST_APPEND_EXPLICIT_TEMPLATE_TYPE(T)) const { for(char* next = address = this->BOOST_NESTED_TEMPLATE apply
(address); !! --n;) this->BOOST_NESTED_TEMPLATE apply
(next = next+sizeof(T)); return address; } BOOST_PP_REPEAT(N, BOOST_DEFINE_INPLACE_FACTORY_CLASS_MEMBER_DECL, _) }; #if N > 0 template< BOOST_PP_ENUM_PARAMS(N, class A) > inline BOOST_PP_CAT(in_place_factory,N)< BOOST_PP_ENUM_PARAMS(N, A) > in_place( BOOST_PP_ENUM_BINARY_PARAMS(N, A, const& a) ) { return BOOST_PP_CAT(in_place_factory,N)< BOOST_PP_ENUM_PARAMS(N, A) > ( BOOST_PP_ENUM_PARAMS(N, a) ); } #else inline in_place_factory0 in_place() { return in_place_factory0(); } #endif #undef N #endif #endif
in_place_factory.hpp
网页地址
文件地址
上一页
5/8
下一页
下载
( 2 KB )
Comments
Total ratings:
0
Average rating:
无评论
of 10
Would you like to comment?
Join now
, or
Logon
if you are already a member.