x
Yes
No
Do you want to visit DriveHQ English website?
首页
产品服务
价格
免费试用
下载客户端
关于我们
云文件服务
|
云备份服务
|
FTP服务
|
企业邮箱服务
|
网站托管
|
客户端软件
云文件服务
云备份服务
FTP服务
企业级邮箱服务
网站托管
客户端软件
keyword.hpp - Hosted on DriveHQ Cloud IT Platform
返回上层目录
上传
下载
共享
发布
新建文件夹
新建文件
复制
剪切
删除
粘贴
评论
升级服务
路径: \\game3dprogramming\materials\GameFactory\GameFactoryDemo\references\boost_1_35_0\boost\parameter\keyword.hpp
旋转
特效
属性
历史版本
// Copyright Daniel Wallin, David Abrahams 2005. 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) #ifndef KEYWORD_050328_HPP #define KEYWORD_050328_HPP #include
#include
#include
namespace boost { namespace parameter { // Instances of unique specializations of keyword<...> serve to // associate arguments with parameter names. For example: // // struct rate_; // parameter names // struct skew_; // namespace // { // keyword
rate; // keywords // keyword
skew; // } // // ... // // f(rate = 1, skew = 2.4); // template
struct keyword { template
typename aux::tag
::type const operator=(T& x) const { typedef typename aux::tag
::type result; return result(x); } template
aux::default_
operator|(Default& default_) const { return aux::default_
(default_); } template
aux::lazy_default
operator||(Default& default_) const { return aux::lazy_default
(default_); } #if !BOOST_WORKAROUND(BOOST_MSVC, < 1300) // avoid partial ordering bugs template
typename aux::tag
::type const operator=(T const& x) const { typedef typename aux::tag
::type result; return result(x); } #endif #if !BOOST_WORKAROUND(BOOST_MSVC, < 1300) // avoid partial ordering bugs template
aux::default_
operator|(const Default& default_) const #if BOOST_WORKAROUND(BOOST_MSVC, == 1300) volatile #endif { return aux::default_
(default_); } template
aux::lazy_default
operator||(Default const& default_) const #if BOOST_WORKAROUND(BOOST_MSVC, == 1300) volatile #endif { return aux::lazy_default
(default_); } #endif public: // Insurance against ODR violations // People will need to define these keywords in header files. To // prevent ODR violations, it's important that the keyword used in // every instantiation of a function template is the same object. // We provide a reference to a common instance of each keyword // object and prevent construction by users. static keyword
const instance; // This interface is deprecated static keyword
& get() { return const_cast
&>(instance); } }; template
keyword
const keyword
::instance = {}; // Reduces boilerplate required to declare and initialize keywords // without violating ODR. Declares a keyword tag type with the given // name in namespace tag_namespace, and declares and initializes a // reference in an anonymous namespace to a singleton instance of that // type. #if BOOST_WORKAROUND(BOOST_MSVC, < 1300) # define BOOST_PARAMETER_KEYWORD(tag_namespace,name) \ namespace tag_namespace \ { \ struct name \ { \ static char const* keyword_name() \ { \ return #name; \ } \ }; \ } \ static ::boost::parameter::keyword
const& name \ = ::boost::parameter::keyword
::instance; #else #define BOOST_PARAMETER_KEYWORD(tag_namespace,name) \ namespace tag_namespace \ { \ struct name \ { \ static char const* keyword_name() \ { \ return #name; \ } \ }; \ } \ namespace \ { \ ::boost::parameter::keyword
const& name \ = ::boost::parameter::keyword
::instance;\ } #endif }} // namespace boost::parameter #endif // KEYWORD_050328_HPP
keyword.hpp
网页地址
文件地址
上一页
3/10
下一页
下载
( 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.