DriveHQ Start Menu
Cloud Drive Mapping
Folder Sync
Cloud Backup
True Drop Box
FTP/SFTP Hosting
Group Account
DriveHQ Start Menu
Online File Server
My Storage
|
Manage Shares
|
Publishes
|
Drop Boxes
|
Group Account
WebDAV Drive Mapping
Cloud Drive Home
|
WebDAV Guide
|
Drive Mapping Tool
|
Drive Mapping URL
Complete Data Backup
Backup Guide
|
Online Backup Tool
|
Cloud-to-Cloud Backup
FTP, Email & Web Service
FTP Home
|
FTP Hosting FAQ
|
Email Hosting
|
EmailManager
|
Web Hosting
Help & Resources
About
|
Enterprise Service
|
Partnership
|
Comparisons
|
Support
Quick Links
Security and Privacy
Download Software
Service Manual
Use Cases
Group Account
Online Help
Blog
Contact
Cloud Surveillance
Sign Up
Login
Features
Business Features
Online File Server
FTP Hosting
Cloud Drive Mapping
Cloud File Backup
Email Backup & Hosting
Cloud File Sharing
Folder Synchronization
Group Management
True Drop Box
Full-text Search
AD Integration/SSO
Mobile Access
IP Camera & DVR Solution
More...
Personal Features
Personal Cloud Drive
Backup All Devices
Mobile APPs
Personal Web Hosting
Sub-Account (for Kids)
Home/PC/Kids Monitoring
More...
Software
DriveHQ Drive Mapping Tool
DriveHQ FileManager
DriveHQ Online Backup
DriveHQ Mobile Apps
Pricing
Business Plans & Pricing
Personal Plans & Pricing
Price Comparison with Others
Feature Comparison with Others
Install Mobile App
Sign up
Creating account...
Invalid character in username! Only 0-9, a-z, A-Z, _, -, . allowed.
Username is required!
Invalid email address!
E-mail is required!
Password is required!
Password is invalid!
Password and confirmation do not match.
Confirm password is required!
I accept
Membership Agreement
Please read the Membership Agreement and check "I accept"!
Free Quick Sign-up
Sign-up Page
Log in
Signing in...
Username or e-mail address is required!
Password is required!
Keep me logged in
Quick Login
Forgot Password
Up
Upload
Download
Share
Publish
New Folder
New File
Copy
Cut
Delete
Paste
Rate
Upgrade
Rotate
Effect
Edit
Slide
History
// Copyright David Abrahams 2003. // 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 COUNTING_ITERATOR_DWA200348_HPP # define COUNTING_ITERATOR_DWA200348_HPP # include
# include
# include
# include
# include
# include
namespace boost { template < class Incrementable , class CategoryOrTraversal , class Difference > class counting_iterator; namespace detail { // Try to detect numeric types at compile time in ways compatible // with the limitations of the compiler and library. template
struct is_numeric_impl { // For a while, this wasn't true, but we rely on it below. This is a regression assert. BOOST_STATIC_ASSERT(::boost::is_integral
::value); # ifndef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS BOOST_STATIC_CONSTANT(bool, value = std::numeric_limits
::is_specialized); # else # if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x551)) BOOST_STATIC_CONSTANT( bool, value = ( boost::is_convertible
::value && boost::is_convertible
::value )); # else BOOST_STATIC_CONSTANT(bool, value = ::boost::is_arithmetic
::value); # endif # endif }; template
struct is_numeric : mpl::bool_<(::boost::detail::is_numeric_impl
::value)> {}; # if defined(BOOST_HAS_LONG_LONG) template <> struct is_numeric< ::boost::long_long_type> : mpl::true_ {}; template <> struct is_numeric< ::boost::ulong_long_type> : mpl::true_ {}; # endif // Some compilers fail to have a numeric_limits specialization template <> struct is_numeric
: mpl::true_ {}; template
struct numeric_difference { typedef typename boost::detail::numeric_traits
::difference_type type; }; BOOST_STATIC_ASSERT(is_numeric
::value); template
struct counting_iterator_base { typedef typename detail::ia_dflt_help< CategoryOrTraversal , mpl::eval_if< is_numeric
, mpl::identity
, iterator_traversal
> >::type traversal; typedef typename detail::ia_dflt_help< Difference , mpl::eval_if< is_numeric
, numeric_difference
, iterator_difference
> >::type difference; typedef iterator_adaptor< counting_iterator
// self , Incrementable // Base , Incrementable // Value # ifndef BOOST_ITERATOR_REF_CONSTNESS_KILLS_WRITABILITY const // MSVC won't strip this. Instead we enable Thomas' // criterion (see boost/iterator/detail/facade_iterator_category.hpp) # endif , traversal , Incrementable const& // reference , difference > type; }; // Template class distance_policy_select -- choose a policy for computing the // distance between counting_iterators at compile-time based on whether or not // the iterator wraps an integer or an iterator, using "poor man's partial // specialization". template
struct distance_policy_select; // A policy for wrapped iterators template
struct iterator_distance { static Difference distance(Incrementable1 x, Incrementable2 y) { return y - x; } }; // A policy for wrapped numbers template
struct number_distance { static Difference distance(Incrementable1 x, Incrementable2 y) { return numeric_distance(x, y); } }; } template < class Incrementable , class CategoryOrTraversal = use_default , class Difference = use_default > class counting_iterator : public detail::counting_iterator_base< Incrementable, CategoryOrTraversal, Difference >::type { typedef typename detail::counting_iterator_base< Incrementable, CategoryOrTraversal, Difference >::type super_t; friend class iterator_core_access; public: typedef typename super_t::difference_type difference_type; counting_iterator() { } counting_iterator(counting_iterator const& rhs) : super_t(rhs.base()) {} counting_iterator(Incrementable x) : super_t(x) { } # if 0 template
counting_iterator( counting_iterator
const& t , typename enable_if_convertible
::type* = 0 ) : super_t(t.base()) {} # endif private: typename super_t::reference dereference() const { return this->base_reference(); } template
difference_type distance_to(counting_iterator
const& y) const { typedef typename mpl::if_< detail::is_numeric
, detail::number_distance
, detail::iterator_distance
>::type d; return d::distance(this->base(), y.base()); } }; // Manufacture a counting iterator for an arbitrary incrementable type template
inline counting_iterator
make_counting_iterator(Incrementable x) { typedef counting_iterator
result_t; return result_t(x); } } // namespace boost::iterator #endif // COUNTING_ITERATOR_DWA200348_HPP
counting_iterator.hpp
Page URL
File URL
Prev 1/17
Next
Download
( 6 KB )
Note: The DriveHQ service banners will NOT be displayed if the file owner is a paid member.
Comments
Total ratings:
0
Average rating:
Not Rated
Would you like to comment?
Join DriveHQ
for a free account, or
Logon
if you are already a member.