x
Yes
No
Do you want to visit DriveHQ English website?
首页
产品服务
价格
免费试用
下载客户端
关于我们
云文件服务
|
云备份服务
|
FTP服务
|
企业邮箱服务
|
网站托管
|
客户端软件
云文件服务
云备份服务
FTP服务
企业级邮箱服务
网站托管
客户端软件
int_iterator.hpp - Hosted on DriveHQ Cloud IT Platform
返回上层目录
上传
下载
共享
发布
新建文件夹
新建文件
复制
剪切
删除
粘贴
评论
升级服务
路径: \\game3dprogramming\materials\GameFactory\GameFactoryDemo\references\boost_1_35_0\boost\pending\detail\int_iterator.hpp
旋转
特效
属性
历史版本
// (C) Copyright Jeremy Siek 1999. // 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_INT_ITERATOR_H #define BOOST_INT_ITERATOR_H #include
#if !defined BOOST_MSVC #include
#endif #include
//using namespace std; #ifndef BOOST_NO_OPERATORS_IN_NAMESPACE namespace boost { #endif // this should use random_access_iterator_helper but I've had // VC++ portablility problems with that. -JGS template
class int_iterator { typedef int_iterator self; public: typedef std::random_access_iterator_tag iterator_category; typedef IntT value_type; typedef IntT& reference; typedef IntT* pointer; typedef std::ptrdiff_t difference_type; inline int_iterator() : _i(0) { } inline int_iterator(IntT i) : _i(i) { } inline int_iterator(const self& x) : _i(x._i) { } inline self& operator=(const self& x) { _i = x._i; return *this; } inline IntT operator*() { return _i; } inline IntT operator[](IntT n) { return _i + n; } inline self& operator++() { ++_i; return *this; } inline self operator++(int) { self t = *this; ++_i; return t; } inline self& operator+=(IntT n) { _i += n; return *this; } inline self operator+(IntT n) { self t = *this; t += n; return t; } inline self& operator--() { --_i; return *this; } inline self operator--(int) { self t = *this; --_i; return t; } inline self& operator-=(IntT n) { _i -= n; return *this; } inline IntT operator-(const self& x) const { return _i - x._i; } inline bool operator==(const self& x) const { return _i == x._i; } // vc++ had a problem finding != in random_access_iterator_helper // need to look into this... for now implementing everything here -JGS inline bool operator!=(const self& x) const { return _i != x._i; } inline bool operator<(const self& x) const { return _i < x._i; } inline bool operator<=(const self& x) const { return _i <= x._i; } inline bool operator>(const self& x) const { return _i > x._i; } inline bool operator>=(const self& x) const { return _i >= x._i; } protected: IntT _i; }; template
inline int_iterator
operator+(IntT n, int_iterator
t) { t += n; return t; } #ifndef BOOST_NO_OPERATORS_IN_NAMESPACE } /* namespace boost */ #endif #ifdef BOOST_NO_OPERATORS_IN_NAMESPACE namespace boost { using ::int_iterator; } #endif #endif /* BOOST_INT_ITERATOR_H */
int_iterator.hpp
网页地址
文件地址
上一页
2/3
下一页
下载
( 2 KB )
Comments
Total ratings:
0
Average rating:
无评论
of 10
Would you like to comment?
Join now
, or
Logon
if you are already a member.