x
Yes
No
Do you want to visit DriveHQ English website?
首页
产品服务
价格
免费试用
下载客户端
关于我们
云文件服务
|
云备份服务
|
FTP服务
|
企业邮箱服务
|
网站托管
|
客户端软件
云文件服务
云备份服务
FTP服务
企业级邮箱服务
网站托管
客户端软件
apply_visitor_binary.hpp - Hosted on DriveHQ Cloud IT Platform
返回上层目录
上传
下载
共享
发布
新建文件夹
新建文件
复制
剪切
删除
粘贴
评论
升级服务
路径: \\game3dprogramming\materials\GameFactory\GameFactoryDemo\references\boost_1_35_0\boost\variant\detail\apply_visitor_binary.hpp
旋转
特效
属性
历史版本
//----------------------------------------------------------------------------- // boost variant/detail/apply_visitor_binary.hpp header file // See http://www.boost.org for updates, documentation, and revision history. //----------------------------------------------------------------------------- // // Copyright (c) 2002-2003 // Eric Friedman // // 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_VARIANT_DETAIL_APPLY_VISITOR_BINARY_HPP #define BOOST_VARIANT_DETAIL_APPLY_VISITOR_BINARY_HPP #include "boost/config.hpp" #include "boost/detail/workaround.hpp" #include "boost/variant/detail/generic_result_type.hpp" #include "boost/variant/detail/apply_visitor_unary.hpp" #include "boost/utility/enable_if.hpp" namespace boost { ////////////////////////////////////////////////////////////////////////// // function template apply_visitor(visitor, visitable1, visitable2) // // Visits visitable1 and visitable2 such that their values (which we // shall call x and y, respectively) are used as arguments in the // expression visitor(x, y). // namespace detail { namespace variant { template
class apply_visitor_binary_invoke { public: // visitor typedefs typedef typename Visitor::result_type result_type; private: // representation Visitor& visitor_; Value1& value1_; public: // structors apply_visitor_binary_invoke(Visitor& visitor, Value1& value1) : visitor_(visitor) , value1_(value1) { } public: // visitor interfaces template
BOOST_VARIANT_AUX_GENERIC_RESULT_TYPE(result_type) operator()(Value2& value2) { return visitor_(value1_, value2); } }; template
class apply_visitor_binary_unwrap { public: // visitor typedefs typedef typename Visitor::result_type result_type; private: // representation Visitor& visitor_; Visitable2& visitable2_; public: // structors apply_visitor_binary_unwrap(Visitor& visitor, Visitable2& visitable2) : visitor_(visitor) , visitable2_(visitable2) { } public: // visitor interfaces template
BOOST_VARIANT_AUX_GENERIC_RESULT_TYPE(result_type) operator()(Value1& value1) { apply_visitor_binary_invoke< Visitor , Value1 > invoker(visitor_, value1); return boost::apply_visitor(invoker, visitable2_); } }; }} // namespace detail::variant // // nonconst-visitor version: // #if !BOOST_WORKAROUND(__EDG__, BOOST_TESTED_AT(302)) # define BOOST_VARIANT_AUX_APPLY_VISITOR_NON_CONST_RESULT_TYPE(V) \ BOOST_VARIANT_AUX_GENERIC_RESULT_TYPE(typename V::result_type) \ /**/ #else // EDG-based compilers # define BOOST_VARIANT_AUX_APPLY_VISITOR_NON_CONST_RESULT_TYPE(V) \ typename enable_if< \ mpl::not_< is_const< V > > \ , BOOST_VARIANT_AUX_GENERIC_RESULT_TYPE(typename V::result_type) \ >::type \ /**/ #endif // EDG-based compilers workaround template
inline BOOST_VARIANT_AUX_APPLY_VISITOR_NON_CONST_RESULT_TYPE(Visitor) apply_visitor( Visitor& visitor , Visitable1& visitable1, Visitable2& visitable2 ) { ::boost::detail::variant::apply_visitor_binary_unwrap< Visitor, Visitable2 > unwrapper(visitor, visitable2); return boost::apply_visitor(unwrapper, visitable1); } #undef BOOST_VARIANT_AUX_APPLY_VISITOR_NON_CONST_RESULT_TYPE // // const-visitor version: // #if !BOOST_WORKAROUND(BOOST_MSVC, <= 1300) template
inline BOOST_VARIANT_AUX_GENERIC_RESULT_TYPE( typename Visitor::result_type ) apply_visitor( const Visitor& visitor , Visitable1& visitable1, Visitable2& visitable2 ) { ::boost::detail::variant::apply_visitor_binary_unwrap< const Visitor, Visitable2 > unwrapper(visitor, visitable2); return boost::apply_visitor(unwrapper, visitable1); } #endif // MSVC7 and below exclusion } // namespace boost #endif // BOOST_VARIANT_DETAIL_APPLY_VISITOR_BINARY_HPP
apply_visitor_binary.hpp
网页地址
文件地址
上一页 1/22
下一页
下载
( 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.