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
// Boost string_algo library collection_traits.hpp header file -------------// // Copyright Pavol Droba 2002-2003. Use, modification and // distribution is subject to 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) // (C) Copyright Thorsten Ottosen 2002-2003. Use, modification and // distribution is subject to 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) // (C) Copyright Jeremy Siek 2001. Use, modification and // distribution is subject to 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) // Original idea of container traits was proposed by Jeremy Siek and // Thorsten Ottosen. This implementation is lightweighted version // of container_traits adapter for usage with string_algo library #ifndef BOOST_RANGE_STRING_COLLECTION_TRAITS_HPP #define BOOST_RANGE_STRING_COLLECTION_TRAITS_HPP #include
#include
#include
#include
// Implementation #include
/*! \file Defines collection_traits class and related free-standing functions. This facility is used to unify the access to different types of collections. It allows the algorithms in the library to work with STL collections, c-style array, null-terminated c-strings (and more) using the same interface. */ namespace boost { namespace algorithm { // collection_traits template class -----------------------------------------// //! collection_traits class /*! Collection traits provide uniform access to different types of collections. This functionality allows to write generic algorithms which work with several different kinds of collections. Currently following collection types are supported: - containers with STL compatible container interface ( see ContainerConcept ) ( i.e. \c std::vector<>, \c std::list<>, \c std::string<> ... ) - c-style array ( \c char[10], \c int[15] ... ) - null-terminated c-strings ( \c char*, \c wchar_T* ) - std::pair of iterators ( i.e \c std::pair
::iterator,vector
::iterator> ) Collection traits provide an external collection interface operations. All are accessible using free-standing functions. The following operations are supported: - \c size() - \c empty() - \c begin() - \c end() Container traits have somewhat limited functionality on compilers not supporting partial template specialization and partial template ordering. */ template< typename T > struct collection_traits { private: typedef BOOST_STRING_TYPENAME ::boost::mpl::eval_if< ::boost::algorithm::detail::is_pair
, detail::pair_container_traits_selector
, BOOST_STRING_TYPENAME ::boost::mpl::eval_if< ::boost::is_array
, detail::array_container_traits_selector
, BOOST_STRING_TYPENAME ::boost::mpl::eval_if< ::boost::is_pointer
, detail::pointer_container_traits_selector
, detail::default_container_traits_selector
> > >::type container_helper_type; public: //! Function type typedef container_helper_type function_type; //! Value type typedef BOOST_STRING_TYPENAME container_helper_type::value_type value_type; //! Size type typedef BOOST_STRING_TYPENAME container_helper_type::size_type size_type; //! Iterator type typedef BOOST_STRING_TYPENAME container_helper_type::iterator iterator; //! Const iterator type typedef BOOST_STRING_TYPENAME container_helper_type::const_iterator const_iterator; //! Result iterator type ( iterator of const_iterator, depending on the constness of the container ) typedef BOOST_STRING_TYPENAME container_helper_type::result_iterator result_iterator; //! Difference type typedef BOOST_STRING_TYPENAME container_helper_type::difference_type difference_type; }; // 'collection_traits' // collection_traits metafunctions -----------------------------------------// //! Container value_type trait /*! Extract the type of elements contained in a container */ template< typename C > struct value_type_of { typedef BOOST_STRING_TYPENAME collection_traits
::value_type type; }; //! Container difference trait /*! Extract the container's difference type */ template< typename C > struct difference_type_of { typedef BOOST_STRING_TYPENAME collection_traits
::difference_type type; }; //! Container iterator trait /*! Extract the container's iterator type */ template< typename C > struct iterator_of { typedef BOOST_STRING_TYPENAME collection_traits
::iterator type; }; //! Container const_iterator trait /*! Extract the container's const_iterator type */ template< typename C > struct const_iterator_of { typedef BOOST_STRING_TYPENAME collection_traits
::const_iterator type; }; //! Container result_iterator /*! Extract the container's result_iterator type. This type maps to \c C::iterator for mutable container and \c C::const_iterator for const containers. */ template< typename C > struct result_iterator_of { typedef BOOST_STRING_TYPENAME collection_traits
::result_iterator type; }; // collection_traits related functions -----------------------------------------// //! Free-standing size() function /*! Get the size of the container. Uses collection_traits. */ template< typename C > inline BOOST_STRING_TYPENAME collection_traits
::size_type size( const C& c ) { return collection_traits
::function_type::size( c ); } //! Free-standing empty() function /*! Check whether the container is empty. Uses container traits. */ template< typename C > inline bool empty( const C& c ) { return collection_traits
::function_type::empty( c ); } #ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING //! Free-standing begin() function /*! Get the begin iterator of the container. Uses collection_traits. */ template< typename C > inline BOOST_STRING_TYPENAME collection_traits
::iterator begin( C& c ) { return collection_traits
::function_type::begin( c ); } //! Free-standing begin() function /*! \overload */ template< typename C > inline BOOST_STRING_TYPENAME collection_traits
::const_iterator begin( const C& c ) { return collection_traits
::function_type::begin( c ); } //! Free-standing end() function /*! Get the begin iterator of the container. Uses collection_traits. */ template< typename C > inline BOOST_STRING_TYPENAME collection_traits
::iterator end( C& c ) { return collection_traits
::function_type::end( c ); } //! Free-standing end() function /*! \overload */ template< typename C > inline BOOST_STRING_TYPENAME collection_traits
::const_iterator end( const C& c ) { return collection_traits
::function_type::end( c ); } #else // BOOST_NO_FUNCTION_TEMPLATE_ORDERING //! Free-standing begin() function /*! \overload */ template< typename C > inline BOOST_STRING_TYPENAME collection_traits
::result_iterator begin( C& c ) { return collection_traits
::function_type::begin( c ); } //! Free-standing end() function /*! \overload */ template< typename C > inline BOOST_STRING_TYPENAME collection_traits
::result_iterator end( C& c ) { return collection_traits
::function_type::end( c ); } #endif // BOOST_NO_FUNCTION_TEMPLATE_ORDERING } // namespace algorithm } // namespace boost #endif // BOOST_STRING_COLLECTION_TRAITS_HPP
collection_traits.hpp
Page URL
File URL
Prev
3/20
Next
Download
( 9 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.