x
Yes
No
Do you want to visit DriveHQ English website?
首页
产品服务
价格
免费试用
下载客户端
关于我们
云文件服务
|
云备份服务
|
FTP服务
|
企业邮箱服务
|
网站托管
|
客户端软件
云文件服务
云备份服务
FTP服务
企业级邮箱服务
网站托管
客户端软件
double_object.hpp - Hosted on DriveHQ Cloud IT Platform
返回上层目录
上传
下载
共享
发布
新建文件夹
新建文件
复制
剪切
删除
粘贴
评论
升级服务
路径: \\game3dprogramming\materials\GameFactory\GameFactoryDemo\references\boost_1_35_0\boost\iostreams\detail\double_object.hpp
旋转
特效
属性
历史版本
// (C) Copyright 2008 CodeRage, LLC (turkanis at coderage dot com) // (C) Copyright 2004-2007 Jonathan Turkanis // 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.) // See http://www.boost.org/libs/iostreams for documentation. // Contains the definition of the class template // boost::iostreams::detail::double_object, which is similar to compressed pair // except that both members of the pair have the same type, and // compression occurs only if requested using a boolean template // parameter. #ifndef BOOST_IOSTREAMS_DETAIL_DOUBLE_OBJECT_HPP_INCLUDED #define BOOST_IOSTREAMS_DETAIL_DOUBLE_OBJECT_HPP_INCLUDED #if defined(_MSC_VER) && (_MSC_VER >= 1020) # pragma once #endif #include
// swap. #include
#include
#if BOOST_WORKAROUND(__MWERKS__, > 0x3003) # include
#else # include
#endif namespace boost { namespace iostreams { namespace detail { template
class single_object_holder { public: #if BOOST_WORKAROUND(__MWERKS__, > 0x3003) typedef Metrowerks::call_traits
traits_type; #else typedef boost::call_traits
traits_type; #endif typedef typename traits_type::param_type param_type; typedef typename traits_type::reference reference; typedef typename traits_type::const_reference const_reference; single_object_holder() { } single_object_holder(param_type t) : first_(t) { } reference first() { return first_; } const_reference first() const { return first_; } reference second() { return first_; } const_reference second() const { return first_; } void swap(single_object_holder& o) { std::swap(first_, o.first_); } private: T first_; }; template
struct double_object_holder { public: #if BOOST_WORKAROUND(__MWERKS__, > 0x3003) typedef Metrowerks::call_traits
traits_type; #else typedef boost::call_traits
traits_type; #endif typedef typename traits_type::param_type param_type; typedef typename traits_type::reference reference; typedef typename traits_type::const_reference const_reference; double_object_holder() { } double_object_holder(param_type t1, param_type t2) : first_(t1), second_(t2) { } reference first() { return first_; } const_reference first() const { return first_; } reference second() { return second_; } const_reference second() const { return second_; } void swap(double_object_holder& d) { std::swap(first_, d.first_); std::swap(second_, d.second_); } private: T first_, second_; }; template
class double_object : public mpl::if_< IsDouble, double_object_holder
, single_object_holder
>::type { private: typedef typename mpl::if_< IsDouble, double_object_holder
, single_object_holder
>::type base_type; public: #if BOOST_WORKAROUND(__MWERKS__, > 0x3003) typedef Metrowerks::call_traits
traits_type; #else typedef boost::call_traits
traits_type; #endif typedef typename traits_type::param_type param_type; typedef typename traits_type::reference reference; typedef typename traits_type::const_reference const_reference; double_object() : base_type() {} double_object(param_type t1, param_type t2) : base_type(t1, t2) { } bool is_double() const { return IsDouble::value; } }; } } } // End namespaces detail, iostreams, boost. #endif // #ifndef BOOST_IOSTREAMS_DETAIL_DOUBLE_OBJECT_HPP_INCLUDED
double_object.hpp
网页地址
文件地址
上一页
14/38
下一页
下载
( 3 KB )
Comments
Total ratings:
0
Average rating:
无评论
of 10
Would you like to comment?
Join now
, or
Logon
if you are already a member.