x
Yes
No
Do you want to visit DriveHQ English website?
首页
产品服务
价格
免费试用
下载客户端
关于我们
云文件服务
|
云备份服务
|
FTP服务
|
企业邮箱服务
|
网站托管
|
客户端软件
云文件服务
云备份服务
FTP服务
企业级邮箱服务
网站托管
客户端软件
object_operators.hpp - Hosted on DriveHQ Cloud IT Platform
返回上层目录
上传
下载
共享
发布
新建文件夹
新建文件
复制
剪切
删除
粘贴
评论
升级服务
路径: \\game3dprogramming\materials\GameFactory\GameFactoryDemo\references\boost_1_35_0\boost\python\object_operators.hpp
旋转
特效
属性
历史版本
// Copyright David Abrahams 2002. // 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 OBJECT_OPERATORS_DWA2002617_HPP # define OBJECT_OPERATORS_DWA2002617_HPP # include
# include
# include
# include
# include
# include
namespace boost { namespace python { namespace api { template
char is_object_operators_helper(object_operators
const*); typedef char (&no_type)[2]; no_type is_object_operators_helper(...); template
X* make_ptr(); template
struct is_object_operators { enum { value = (sizeof(api::is_object_operators_helper(api::make_ptr
())) + sizeof(api::is_object_operators_helper(api::make_ptr
())) < 4 ) }; typedef mpl::bool_
type; }; # if !defined(BOOST_NO_SFINAE) && !defined(BOOST_NO_IS_CONVERTIBLE) template
struct enable_binary : boost::iterators::enable_if
, T> {}; # define BOOST_PYTHON_BINARY_RETURN(T) typename enable_binary
::type # else # define BOOST_PYTHON_BINARY_RETURN(T) T # endif template
object object_operators
::operator()() const { object_cref2 f = *static_cast
(this); return call
(f.ptr()); } template
inline object_operators
::operator bool_type() const { object_cref2 x = *static_cast
(this); return PyObject_IsTrue(x.ptr()) ? &object::ptr : 0; } template
inline bool object_operators
::operator!() const { object_cref2 x = *static_cast
(this); return !PyObject_IsTrue(x.ptr()); } # define BOOST_PYTHON_COMPARE_OP(op, opid) \ template
\ BOOST_PYTHON_BINARY_RETURN(object) operator op(L const& l, R const& r) \ { \ return PyObject_RichCompare( \ object(l).ptr(), object(r).ptr(), opid); \ } # undef BOOST_PYTHON_COMPARE_OP # define BOOST_PYTHON_BINARY_OPERATOR(op) \ BOOST_PYTHON_DECL object operator op(object const& l, object const& r); \ template
\ BOOST_PYTHON_BINARY_RETURN(object) operator op(L const& l, R const& r) \ { \ return object(l) op object(r); \ } BOOST_PYTHON_BINARY_OPERATOR(>) BOOST_PYTHON_BINARY_OPERATOR(>=) BOOST_PYTHON_BINARY_OPERATOR(<) BOOST_PYTHON_BINARY_OPERATOR(<=) BOOST_PYTHON_BINARY_OPERATOR(==) BOOST_PYTHON_BINARY_OPERATOR(!=) BOOST_PYTHON_BINARY_OPERATOR(+) BOOST_PYTHON_BINARY_OPERATOR(-) BOOST_PYTHON_BINARY_OPERATOR(*) BOOST_PYTHON_BINARY_OPERATOR(/) BOOST_PYTHON_BINARY_OPERATOR(%) BOOST_PYTHON_BINARY_OPERATOR(<<) BOOST_PYTHON_BINARY_OPERATOR(>>) BOOST_PYTHON_BINARY_OPERATOR(&) BOOST_PYTHON_BINARY_OPERATOR(^) BOOST_PYTHON_BINARY_OPERATOR(|) # undef BOOST_PYTHON_BINARY_OPERATOR # define BOOST_PYTHON_INPLACE_OPERATOR(op) \ BOOST_PYTHON_DECL object& operator op(object& l, object const& r); \ template
\ object& operator op(object& l, R const& r) \ { \ return l op object(r); \ } BOOST_PYTHON_INPLACE_OPERATOR(+=) BOOST_PYTHON_INPLACE_OPERATOR(-=) BOOST_PYTHON_INPLACE_OPERATOR(*=) BOOST_PYTHON_INPLACE_OPERATOR(/=) BOOST_PYTHON_INPLACE_OPERATOR(%=) BOOST_PYTHON_INPLACE_OPERATOR(<<=) BOOST_PYTHON_INPLACE_OPERATOR(>>=) BOOST_PYTHON_INPLACE_OPERATOR(&=) BOOST_PYTHON_INPLACE_OPERATOR(^=) BOOST_PYTHON_INPLACE_OPERATOR(|=) # undef BOOST_PYTHON_INPLACE_OPERATOR }}} // namespace boost::python #include
#endif // OBJECT_OPERATORS_DWA2002617_HPP
object_operators.hpp
网页地址
文件地址
上一页
49/85
下一页
下载
( 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.