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
// (C) Copyright Eric Niebler 2004-2005 // (C) Copyright Gennadiy Rozental 2005-2007. // 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/test for the library home page. // // File : $RCSfile$ // // Version : $Revision: 41369 $ // // Description : this is an abridged version of an excelent BOOST_FOREACH facility // presented by Eric Niebler. I am so fond of it so I couldn't wait till it // going to be accepted into Boost. Also I need version with less number of dependencies // and more portable. This version doesn't support rvalues and will reeveluate it's // parameters, but should be good enough for my purposes. // *************************************************************************** #ifndef BOOST_TEST_FOREACH_HPP_021005GER #define BOOST_TEST_FOREACH_HPP_021005GER // Boost.Test #include
// Boost #include
#include
#include
#include
#include
//____________________________________________________________________________// namespace boost { namespace unit_test { namespace for_each { // ************************************************************************** // // ************** static_any ************** // // ************************************************************************** // struct static_any_base { operator bool() const { return false; } }; //____________________________________________________________________________// template
struct static_any : static_any_base { static_any( Iter const& t ) : m_it( t ) {} mutable Iter m_it; }; //____________________________________________________________________________// typedef static_any_base const& static_any_t; //____________________________________________________________________________// template
inline Iter& static_any_cast( static_any_t a, Iter* = 0 ) { return static_cast
( static_cast
const&>( a ).m_it ); } //____________________________________________________________________________// // ************************************************************************** // // ************** is_const ************** // // ************************************************************************** // template
inline is_const
is_const_coll( C& ) { return is_const
(); } //____________________________________________________________________________// // ************************************************************************** // // ************** begin ************** // // ************************************************************************** // template
inline static_any
begin( C& t, mpl::false_ ) { return static_any
( t.begin() ); } //____________________________________________________________________________// template
inline static_any
begin( C const& t, mpl::true_ ) { return static_any
( t.begin() ); } //____________________________________________________________________________// // ************************************************************************** // // ************** end ************** // // ************************************************************************** // template
inline static_any
end( C& t, mpl::false_ ) { return static_any
( t.end() ); } //____________________________________________________________________________// template
inline static_any
end( C const& t, mpl::true_ ) { return static_any
( t.end() ); } //____________________________________________________________________________// // ************************************************************************** // // ************** done ************** // // ************************************************************************** // template
inline bool done( static_any_t cur, static_any_t end, C&, mpl::false_ ) { return static_any_cast
( cur ) == static_any_cast
( end ); } //____________________________________________________________________________// template
inline bool done( static_any_t cur, static_any_t end, C const&, mpl::true_ ) { return static_any_cast
( cur ) == static_any_cast
( end ); } //____________________________________________________________________________// // ************************************************************************** // // ************** next ************** // // ************************************************************************** // template
inline void next( static_any_t cur, C&, mpl::false_ ) { ++static_any_cast
( cur ); } //____________________________________________________________________________// template
inline void next( static_any_t cur, C const&, mpl::true_ ) { ++static_any_cast
( cur ); } //____________________________________________________________________________// // ************************************************************************** // // ************** deref ************** // // ************************************************************************** // template
inline RefType deref( static_any_t cur, C&, ::boost::type
, mpl::false_ ) { return *static_any_cast
( cur ); } //____________________________________________________________________________// template
inline RefType deref( static_any_t cur, C const&, ::boost::type
, mpl::true_ ) { return *static_any_cast
( cur ); } //____________________________________________________________________________// // ************************************************************************** // // ************** BOOST_TEST_FOREACH ************** // // ************************************************************************** // #if BOOST_WORKAROUND(__GNUC__, < 3) #define BOOST_TEST_FE_MULTISTATEMENT #endif #define BOOST_TEST_FE_ANY ::boost::unit_test::for_each::static_any_t #define BOOST_TEST_FE_IS_CONST( COL ) ::boost::unit_test::for_each::is_const_coll( COL ) #define BOOST_TEST_FE_BEG( COL ) \ ::boost::unit_test::for_each::begin( \ COL, \ BOOST_TEST_FE_IS_CONST( COL ) ) \ /**/ #define BOOST_TEST_FE_END( COL ) \ ::boost::unit_test::for_each::end( \ COL, \ BOOST_TEST_FE_IS_CONST( COL ) ) \ /**/ #define BOOST_TEST_FE_DONE( COL ) \ ::boost::unit_test::for_each::done( \ BOOST_TEST_FE_CUR_VAR, \ BOOST_TEST_FE_END_VAR, \ COL, \ BOOST_TEST_FE_IS_CONST( COL ) ) \ /**/ #define BOOST_TEST_FE_NEXT( COL ) \ ::boost::unit_test::for_each::next( \ BOOST_TEST_FE_CUR_VAR, \ COL, \ BOOST_TEST_FE_IS_CONST( COL ) ) \ /**/ #define BOOST_FOREACH_NOOP(COL) \ ((void)&(COL)) #define BOOST_TEST_FE_DEREF( COL, RefType ) \ ::boost::unit_test::for_each::deref( \ BOOST_TEST_FE_CUR_VAR, \ COL, \ ::boost::type
(), \ BOOST_TEST_FE_IS_CONST( COL ) ) \ /**/ #if BOOST_WORKAROUND( BOOST_MSVC, == 1310 ) #define BOOST_TEST_LINE_NUM #else #define BOOST_TEST_LINE_NUM __LINE__ #endif #define BOOST_TEST_FE_CUR_VAR BOOST_JOIN( _fe_cur_, BOOST_TEST_LINE_NUM ) #define BOOST_TEST_FE_END_VAR BOOST_JOIN( _fe_end_, BOOST_TEST_LINE_NUM ) #define BOOST_TEST_FE_CON_VAR BOOST_JOIN( _fe_con_, BOOST_TEST_LINE_NUM ) #ifndef BOOST_TEST_FE_MULTISTATEMENT #define BOOST_TEST_FOREACH( RefType, var, COL ) \ if( BOOST_TEST_FE_ANY BOOST_TEST_FE_CUR_VAR = BOOST_TEST_FE_BEG( COL ) ) {} else \ if( BOOST_TEST_FE_ANY BOOST_TEST_FE_END_VAR = BOOST_TEST_FE_END( COL ) ) {} else \ for( bool BOOST_TEST_FE_CON_VAR = true; \ BOOST_TEST_FE_CON_VAR && !BOOST_TEST_FE_DONE( COL ); \ BOOST_TEST_FE_CON_VAR ? BOOST_TEST_FE_NEXT( COL ) : BOOST_FOREACH_NOOP( COL )) \ \ if( (BOOST_TEST_FE_CON_VAR = false, false) ) {} else \ for( RefType var = BOOST_TEST_FE_DEREF( COL, RefType ); \ !BOOST_TEST_FE_CON_VAR; BOOST_TEST_FE_CON_VAR = true ) \ /**/ #else #define BOOST_TEST_FOREACH( RefType, var, COL ) \ BOOST_TEST_FE_ANY BOOST_TEST_FE_CUR_VAR = BOOST_TEST_FE_BEG( COL ), \ BOOST_TEST_FE_END_VAR = BOOST_TEST_FE_END( COL ); \ \ for( bool BOOST_TEST_FE_CON_VAR = true; BOOST_TEST_FE_CON_VAR; ) \ for( ; \ BOOST_TEST_FE_CON_VAR && (BOOST_TEST_FE_CON_VAR = !BOOST_TEST_FE_DONE( COL )); \ BOOST_TEST_FE_CON_VAR ? BOOST_TEST_FE_NEXT( COL ) : BOOST_FOREACH_NOOP( COL )) \ \ if( (BOOST_TEST_FE_CON_VAR = false, false) ) {} else \ for( RefType var = BOOST_TEST_FE_DEREF( COL, RefType ); \ !BOOST_TEST_FE_CON_VAR; BOOST_TEST_FE_CON_VAR = true ) \ /**/ #endif //____________________________________________________________________________// } // namespace for_each } // namespace unit_test } // namespace boost //____________________________________________________________________________// #include
#endif // BOOST_TEST_FOREACH_HPP_021005GER
foreach.hpp
Page URL
File URL
Prev
7/13
Next
Download
( 11 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.