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 (c) 2001-2006 Joel de Guzman Copyright (c) 2006 Dan Marsden 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) ==============================================================================*/ #if !defined(BOOST_FUSION_FOLD_HPP_20070528_1253) #define BOOST_FUSION_FOLD_HPP_20070528_1253 #include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
namespace boost { namespace fusion { namespace result_of { template
struct fold; } namespace detail { template
struct apply_fold_result { template
struct apply : boost::result_of
{}; }; template
struct fold_apply { typedef typename result_of::deref
::type dereferenced; typedef typename add_reference
::type>::type lvalue_state; typedef typename boost::result_of
::type type; }; template
struct static_fold; template
struct next_result_of_fold { typedef typename static_fold< typename result_of::next
::type , Last , typename fold_apply
::type , F >::type type; }; template
struct static_fold { typedef typename mpl::if_< result_of::equal_to
, mpl::identity
, next_result_of_fold
>::type result; typedef typename result::type type; }; template
struct result_of_unrolled_fold; template
struct unrolled_fold { template
static typename result_of_unrolled_fold
::type call(I0 const& i0, State const& state, F f) { typedef typename result_of::next
::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next
::type I2; I2 i2 = fusion::next(i1); typedef typename result_of::next
::type I3; I3 i3 = fusion::next(i2); typedef typename result_of::next
::type I4; I4 i4 = fusion::next(i3); return unrolled_fold
::call(i4, f(*i3, f(*i2, f(*i1, f(*i0, state)))), f); } }; template<> struct unrolled_fold<3> { template
static typename result_of_unrolled_fold
::type call(I0 const& i0, State const& state, F f) { typedef typename result_of::next
::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next
::type I2; I2 i2 = fusion::next(i1); return f(*i2, f(*i1, f(*i0, state))); } }; template<> struct unrolled_fold<2> { template
static typename result_of_unrolled_fold
::type call(I0 const& i0, State const& state, F f) { typedef typename result_of::next
::type I1; I1 i1 = fusion::next(i0); return f(*i1, f(*i0, state)); } }; template<> struct unrolled_fold<1> { template
static typename result_of_unrolled_fold
::type call(I0 const& i0, State const& state, F f) { return f(*i0, state); } }; template<> struct unrolled_fold<0> { template
static State call(I0 const&, State const& state, F) { return state; } }; // terminal case template
inline State const& linear_fold(First const&, Last const&, State const& state, F, mpl::true_) { return state; } // non-terminal case template
inline typename static_fold
::type linear_fold( First const& first , Last const& last , State const& state , F f , mpl::false_) { return detail::linear_fold( fusion::next(first) , last , f(*first, state) , f , result_of::equal_to
::type, Last>() ); } template
struct result_of_unrolled_fold { typedef typename result_of::next
::type I1; typedef typename result_of::next
::type I2; typedef typename result_of::next
::type I3; typedef typename result_of::next
::type I4; typedef typename fold_apply
::type Rest1; typedef typename fold_apply
::type Rest2; typedef typename fold_apply
::type Rest3; typedef typename fold_apply
::type Rest4; typedef typename result_of_unrolled_fold
::type type; }; template
struct result_of_unrolled_fold
{ typedef typename result_of::next
::type I1; typedef typename result_of::next
::type I2; typedef typename fold_apply
::type Rest; typedef typename fold_apply
::type Rest2; typedef typename fold_apply
::type type; }; template
struct result_of_unrolled_fold
{ typedef typename result_of::next
::type I1; typedef typename fold_apply
::type Rest; typedef typename fold_apply
::type type; }; template
struct result_of_unrolled_fold
{ typedef typename fold_apply
::type type; }; template
struct result_of_unrolled_fold
{ typedef State type; }; template
struct choose_fold; template
struct choose_fold
{ typedef typename result_of::begin
::type begin; typedef typename result_of::end
::type end; typedef typename result_of_unrolled_fold< begin, State, F, result_of::distance
::type::value>::type type; }; template
struct choose_fold
{ typedef typename detail::static_fold< typename result_of::begin
::type , typename result_of::end
::type , State , F >::type type; }; template
typename result_of::fold
::type fold(Sequence& seq, State const& state, F f, Tag) { return linear_fold( fusion::begin(seq) , fusion::end(seq) , state , f , result_of::equal_to< typename result_of::begin
::type , typename result_of::end
::type>() ); } template
typename result_of::fold
::type fold(Sequence& seq, State const& state, F f, random_access_traversal_tag) { typedef typename result_of::begin
::type begin; typedef typename result_of::end
::type end; return unrolled_fold
::type::value>::call( fusion::begin(seq) , state , f); } }}} #endif
fold.hpp
Page URL
File URL
Prev 1/2
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.