x
Yes
No
Do you want to visit DriveHQ English website?
首页
产品服务
价格
免费试用
下载客户端
关于我们
云文件服务
|
云备份服务
|
FTP服务
|
企业邮箱服务
|
网站托管
|
客户端软件
云文件服务
云备份服务
FTP服务
企业级邮箱服务
网站托管
客户端软件
casts.hpp - Hosted on DriveHQ Cloud IT Platform
返回上层目录
上传
下载
共享
发布
新建文件夹
新建文件
复制
剪切
删除
粘贴
评论
升级服务
路径: \\game3dprogramming\materials\GameFactory\GameFactoryDemo\references\boost_1_35_0\boost\lambda\casts.hpp
旋转
特效
属性
历史版本
// - casts.hpp -- BLambda Library ------------- // // Copyright (C) 2000 Gary Powell (powellg@amazon.com) // Copyright (C) 1999, 2000 Jaakko J�rvi (jaakko.jarvi@cs.utu.fi) // // 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) // // For more information, see http://www.boost.org // ----------------------------------------------- #if !defined(BOOST_LAMBDA_CASTS_HPP) #define BOOST_LAMBDA_CASTS_HPP #include
namespace boost { namespace lambda { template
class cast_action; template
class static_cast_action; template
class dynamic_cast_action; template
class const_cast_action; template
class reinterpret_cast_action; class typeid_action; class sizeof_action; // Cast actions template
class cast_action
> { public: template
static RET apply(Arg1 &a1) { return static_cast
(a1); } }; template
class cast_action
> { public: template
static RET apply(Arg1 &a1) { return dynamic_cast
(a1); } }; template
class cast_action
> { public: template
static RET apply(Arg1 &a1) { return const_cast
(a1); } }; template
class cast_action
> { public: template
static RET apply(Arg1 &a1) { return reinterpret_cast
(a1); } }; // typedid action class typeid_action { public: template
static RET apply(Arg1 &a1) { return typeid(a1); } }; // sizeof action class sizeof_action { public: template
static RET apply(Arg1 &a1) { return sizeof(a1); } }; // return types of casting lambda_functors (all "T" type.) template
class cast_type, class T, class A> struct return_type_N
>, A> { typedef T type; }; // return type of typeid_action template
struct return_type_N
{ typedef std::type_info const & type; }; // return type of sizeof_action template
struct return_type_N
{ typedef std::size_t type; }; // the four cast & typeid overloads. // casts can take ordinary variables (not just lambda functors) // static_cast template
inline const lambda_functor< lambda_functor_base< action<1, cast_action
> >, tuple
::type> > > ll_static_cast(const Arg1& a1) { return lambda_functor_base< action<1, cast_action
> >, tuple
::type> > ( tuple
::type>(a1)); } // dynamic_cast template
inline const lambda_functor< lambda_functor_base< action<1, cast_action
> >, tuple
::type> > > ll_dynamic_cast(const Arg1& a1) { return lambda_functor_base< action<1, cast_action
> >, tuple
::type> > ( tuple
::type>(a1)); } // const_cast template
inline const lambda_functor< lambda_functor_base< action<1, cast_action
> >, tuple
::type> > > ll_const_cast(const Arg1& a1) { return lambda_functor_base< action<1, cast_action
> >, tuple
::type> > ( tuple
::type>(a1)); } // reinterpret_cast template
inline const lambda_functor< lambda_functor_base< action<1, cast_action
> >, tuple
::type> > > ll_reinterpret_cast(const Arg1& a1) { return lambda_functor_base< action<1, cast_action
> >, tuple
::type> > ( tuple
::type>(a1)); } // typeid // can be applied to a normal variable as well (can refer to a polymorphic // class object) template
inline const lambda_functor< lambda_functor_base< action<1, typeid_action>, tuple
::type> > > ll_typeid(const Arg1& a1) { return lambda_functor_base< action<1, typeid_action>, tuple
::type> > ( tuple
::type>(a1)); } // sizeof(expression) // Always takes a lambda expression (if not, built in sizeof will do) template
inline const lambda_functor< lambda_functor_base< action<1, sizeof_action>, tuple
> > > ll_sizeof(const lambda_functor
& a1) { return lambda_functor_base< action<1, sizeof_action>, tuple
> > ( tuple
>(a1)); } } // namespace lambda } // namespace boost #endif
casts.hpp
网页地址
文件地址
上一页
3/13
下一页
下载
( 5 KB )
Comments
Total ratings:
0
Average rating:
无评论
of 10
Would you like to comment?
Join now
, or
Logon
if you are already a member.