x
Yes
No
Do you want to visit DriveHQ English website?
首页
产品服务
价格
免费试用
下载客户端
关于我们
云文件服务
|
云备份服务
|
FTP服务
|
企业邮箱服务
|
网站托管
|
客户端软件
云文件服务
云备份服务
FTP服务
企业级邮箱服务
网站托管
客户端软件
sub_match_vector.hpp - Hosted on DriveHQ Cloud IT Platform
返回上层目录
上传
下载
共享
发布
新建文件夹
新建文件
复制
剪切
删除
粘贴
评论
升级服务
路径: \\game3dprogramming\materials\GameFactory\GameFactoryDemo\references\boost_1_35_0\boost\xpressive\detail\core\sub_match_vector.hpp
旋转
特效
属性
历史版本
/////////////////////////////////////////////////////////////////////////////// // sub_match_vector.hpp // // Copyright 2007 Eric Niebler. 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_XPRESSIVE_DETAIL_CORE_SUB_MATCH_VECTOR_HPP_EAN_10_04_2005 #define BOOST_XPRESSIVE_DETAIL_CORE_SUB_MATCH_VECTOR_HPP_EAN_10_04_2005 // MS compatible compilers support #pragma once #if defined(_MSC_VER) && (_MSC_VER >= 1020) # pragma once #endif #include
#include
#include
#include
namespace boost { namespace xpressive { namespace detail { #if BOOST_ITERATOR_ADAPTORS_VERSION >= 0x0200 ////////////////////////////////////////////////////////////////////////// // sub_match_iterator // template
struct sub_match_iterator : iterator_adaptor < sub_match_iterator
, MainIter , Value , std::random_access_iterator_tag > { typedef iterator_adaptor < sub_match_iterator
, MainIter , Value , std::random_access_iterator_tag > base_t; sub_match_iterator(MainIter baseiter) : base_t(baseiter) { } }; #endif ////////////////////////////////////////////////////////////////////////// // sub_match_vector // template
struct sub_match_vector : private noncopyable { private: struct dummy { int i_; }; typedef int dummy::*bool_type; public: typedef sub_match
value_type; typedef std::size_t size_type; typedef value_type const &const_reference; typedef const_reference reference; typedef typename iterator_difference
::type difference_type; typedef typename iterator_value
::type char_type; typedef typename sub_match
::string_type string_type; #if BOOST_ITERATOR_ADAPTORS_VERSION >= 0x0200 typedef sub_match_iterator < value_type const , sub_match_impl
const * > const_iterator; #else typedef iterator_adaptor < sub_match_impl
const * , default_iterator_policies , value_type , value_type const & , value_type const * > const_iterator; #endif // BOOST_ITERATOR_ADAPTORS_VERSION < 0x0200 typedef const_iterator iterator; sub_match_vector() : size_(0) , sub_matches_(0) { } const_reference operator [](size_type index) const { static value_type const s_null; return (index >= this->size_) ? s_null : *static_cast
(&this->sub_matches_[ index ]); } size_type size() const { return this->size_; } bool empty() const { return 0 == this->size(); } const_iterator begin() const { return const_iterator(this->sub_matches_); } const_iterator end() const { return const_iterator(this->sub_matches_ + this->size_); } operator bool_type() const { return (!this->empty() && (*this)[0].matched) ? &dummy::i_ : 0; } bool operator !() const { return this->empty() || !(*this)[0].matched; } void swap(sub_match_vector
&that) { std::swap(this->size_, that.size_); std::swap(this->sub_matches_, that.sub_matches_); } private: friend struct detail::core_access
; void init_(sub_match_impl
*sub_matches, size_type size) { this->size_ = size; this->sub_matches_ = sub_matches; } void init_(sub_match_impl
*sub_matches, size_type size, sub_match_vector
const &that) { BOOST_ASSERT(size == that.size_); this->size_ = size; this->sub_matches_ = sub_matches; std::copy(that.sub_matches_, that.sub_matches_ + that.size_, this->sub_matches_); } size_type size_; sub_match_impl
*sub_matches_; }; }}} // namespace boost::xpressive::detail #endif
sub_match_vector.hpp
网页地址
文件地址
上一页
16/16 下一页
下载
( 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.