x
Yes
No
Do you want to visit DriveHQ English website?
首页
产品服务
价格
免费试用
下载客户端
关于我们
云文件服务
|
云备份服务
|
FTP服务
|
企业邮箱服务
|
网站托管
|
客户端软件
云文件服务
云备份服务
FTP服务
企业级邮箱服务
网站托管
客户端软件
forward.hpp - Hosted on DriveHQ Cloud IT Platform
返回上层目录
上传
下载
共享
发布
新建文件夹
新建文件
复制
剪切
删除
粘贴
评论
升级服务
路径: \\game3dprogramming\materials\GameFactory\GameFactoryDemo\references\boost_1_35_0\boost\python\object\forward.hpp
旋转
特效
属性
历史版本
// Copyright David Abrahams 2001. // 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 FORWARD_DWA20011215_HPP # define FORWARD_DWA20011215_HPP # include
# include
# include
# include
# include
# include
# include
# if BOOST_WORKAROUND(BOOST_MSVC, < 1300) # include
# include
# include
# else # include
# endif namespace boost { namespace python { namespace objects { // Very much like boost::reference_wrapper
, except that in this // case T can be a reference already without causing a // reference-to-reference error. template
struct reference_to_value { typedef typename add_reference
::type>::type reference; reference_to_value(reference x) : m_value(x) {} reference get() const { return m_value; } private: reference m_value; }; // A little metaprogram which selects the type to pass through an // intermediate forwarding function when the destination argument type // is T. template
struct forward : mpl::if_< # if BOOST_WORKAROUND(BOOST_MSVC, < 1300) // vc6 chokes on unforwarding enums nested in classes mpl::and_< is_scalar
, mpl::not_< is_enum
> > # else mpl::or_
, is_scalar
> # endif , T , reference_to_value
> { }; # ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION template
struct unforward { typedef typename unwrap_reference
::type& type; }; template
struct unforward
> { typedef T type; }; template
struct unforward_cref : python::detail::value_arg< typename unwrap_reference
::type > { }; template
struct unforward_cref
> : add_reference
::type> { }; # else // no partial specialization namespace detail { typedef char (&yes_reference_to_value_t)[1]; typedef char (&no_reference_to_value_t)[2]; no_reference_to_value_t is_reference_to_value_test(...); template
yes_reference_to_value_t is_reference_to_value_test(boost::type< reference_to_value
>); template
struct unforwarder { template
struct apply { typedef typename unwrap_reference
::type& type; }; }; template<> struct unforwarder
{ template
struct apply { typedef typename T::reference type; }; }; template
struct cref_unforwarder { template
struct apply : python::detail::value_arg< typename unwrap_reference
::type > { }; }; template<> struct cref_unforwarder
{ template
struct apply : python::detail::value_arg< typename T::reference > { }; }; template
struct is_reference_to_value { BOOST_STATIC_CONSTANT( bool, value = ( sizeof(is_reference_to_value_test(boost::type
())) == sizeof(yes_reference_to_value_t))); typedef mpl::bool_
type; }; } template
struct unforward : public detail::unforwarder< detail::is_reference_to_value
::value >::template apply
{}; template
struct unforward_cref : public detail::cref_unforwarder< detail::is_reference_to_value
::value >::template apply
{}; # endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION template
typename reference_to_value
::reference do_unforward(reference_to_value
const& x, int) { return x.get(); } template
typename reference_wrapper
::type& do_unforward(reference_wrapper
const& x, int) { return x.get(); } template
T const& do_unforward(T const& x, ...) { return x; } }}} // namespace boost::python::objects #endif // FORWARD_DWA20011215_HPP
forward.hpp
网页地址
文件地址
上一页
8/27
下一页
下载
( 4 KB )
Comments
Total ratings:
0
Average rating:
无评论
of 10
Would you like to comment?
Join now
, or
Logon
if you are already a member.