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 Lambda Library - operators.hpp -------------------------------------- // Copyright (C) 1999, 2000 Jaakko J�rvi (jaakko.jarvi@cs.utu.fi) // // 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) // // For more information, see www.boost.org // --------------------------------------------------------------- #ifndef BOOST_LAMBDA_OPERATORS_HPP #define BOOST_LAMBDA_OPERATORS_HPP #include "boost/lambda/detail/is_instance_of.hpp" namespace boost { namespace lambda { #if defined BOOST_LAMBDA_BE1 #error "Multiple defines of BOOST_LAMBDA_BE1" #endif // For all BOOSTA_LAMBDA_BE* macros: // CONSTA must be either 'A' or 'const A' // CONSTB must be either 'B' or 'const B' // It is stupid to have the names A and B as macro arguments, but it avoids // the need to pass in emtpy macro arguments, which gives warnings on some // compilers #define BOOST_LAMBDA_BE1(OPER_NAME, ACTION, CONSTA, CONSTB, CONVERSION) \ template
\ inline const \ lambda_functor< \ lambda_functor_base< \ ACTION, \ tuple
, typename CONVERSION
::type> \ > \ > \ OPER_NAME (const lambda_functor
& a, CONSTB& b) { \ return \ lambda_functor_base< \ ACTION, \ tuple
, typename CONVERSION
::type> \ > \ (tuple
, typename CONVERSION
::type>(a, b)); \ } #if defined BOOST_LAMBDA_BE2 #error "Multiple defines of BOOST_LAMBDA_BE2" #endif #define BOOST_LAMBDA_BE2(OPER_NAME, ACTION, CONSTA, CONSTB, CONVERSION) \ template
\ inline const \ lambda_functor< \ lambda_functor_base< \ ACTION, \ tuple
::type, lambda_functor
> \ > \ > \ OPER_NAME (CONSTA& a, const lambda_functor
& b) { \ return \ lambda_functor_base< \ ACTION, \ tuple
::type, lambda_functor
> \ > \ (tuple
::type, lambda_functor
>(a, b)); \ } #if defined BOOST_LAMBDA_BE3 #error "Multiple defines of BOOST_LAMBDA_BE3" #endif #define BOOST_LAMBDA_BE3(OPER_NAME, ACTION, CONSTA, CONSTB, CONVERSION) \ template
\ inline const \ lambda_functor< \ lambda_functor_base< \ ACTION, \ tuple
, lambda_functor
> \ > \ > \ OPER_NAME (const lambda_functor
& a, const lambda_functor
& b) { \ return \ lambda_functor_base< \ ACTION, \ tuple
, lambda_functor
> \ > \ (tuple
, lambda_functor
>(a, b)); \ } #if defined BOOST_LAMBDA_BE #error "Multiple defines of BOOST_LAMBDA_BE" #endif #define BOOST_LAMBDA_BE(OPER_NAME, ACTION, CONSTA, CONSTB, CONST_CONVERSION) \ BOOST_LAMBDA_BE1(OPER_NAME, ACTION, CONSTA, CONSTB, CONST_CONVERSION) \ BOOST_LAMBDA_BE2(OPER_NAME, ACTION, CONSTA, CONSTB, CONST_CONVERSION) \ BOOST_LAMBDA_BE3(OPER_NAME, ACTION, CONSTA, CONSTB, CONST_CONVERSION) #define BOOST_LAMBDA_EMPTY() BOOST_LAMBDA_BE(operator+, arithmetic_action
, const A, const B, const_copy_argument) BOOST_LAMBDA_BE(operator-, arithmetic_action
, const A, const B, const_copy_argument) BOOST_LAMBDA_BE(operator*, arithmetic_action
, const A, const B, const_copy_argument) BOOST_LAMBDA_BE(operator/, arithmetic_action
, const A, const B, const_copy_argument) BOOST_LAMBDA_BE(operator%, arithmetic_action
, const A, const B, const_copy_argument) BOOST_LAMBDA_BE(operator<<, bitwise_action
, const A, const B, const_copy_argument) BOOST_LAMBDA_BE(operator>>, bitwise_action
, const A, const B, const_copy_argument) BOOST_LAMBDA_BE(operator&, bitwise_action
, const A, const B, const_copy_argument) BOOST_LAMBDA_BE(operator|, bitwise_action
, const A, const B, const_copy_argument) BOOST_LAMBDA_BE(operator^, bitwise_action
, const A, const B, const_copy_argument) BOOST_LAMBDA_BE(operator&&, logical_action
, const A, const B, const_copy_argument) BOOST_LAMBDA_BE(operator||, logical_action
, const A, const B, const_copy_argument) BOOST_LAMBDA_BE(operator<, relational_action
, const A, const B, const_copy_argument) BOOST_LAMBDA_BE(operator>, relational_action
, const A, const B, const_copy_argument) BOOST_LAMBDA_BE(operator<=, relational_action
, const A, const B, const_copy_argument) BOOST_LAMBDA_BE(operator>=, relational_action
, const A, const B, const_copy_argument) BOOST_LAMBDA_BE(operator==, relational_action
, const A, const B, const_copy_argument) BOOST_LAMBDA_BE(operator!=, relational_action
, const A, const B, const_copy_argument) BOOST_LAMBDA_BE(operator+=, arithmetic_assignment_action
, A, const B, reference_argument) BOOST_LAMBDA_BE(operator-=, arithmetic_assignment_action
, A, const B, reference_argument) BOOST_LAMBDA_BE(operator*=, arithmetic_assignment_action
, A, const B, reference_argument) BOOST_LAMBDA_BE(operator/=, arithmetic_assignment_action
, A, const B, reference_argument) BOOST_LAMBDA_BE(operator%=, arithmetic_assignment_action
, A, const B, reference_argument) BOOST_LAMBDA_BE(operator<<=, bitwise_assignment_action
, A, const B, reference_argument) BOOST_LAMBDA_BE(operator>>=, bitwise_assignment_action
, A, const B, reference_argument) BOOST_LAMBDA_BE(operator&=, bitwise_assignment_action
, A, const B, reference_argument) BOOST_LAMBDA_BE(operator|=, bitwise_assignment_action
, A, const B, reference_argument) BOOST_LAMBDA_BE(operator^=, bitwise_assignment_action
, A, const B, reference_argument) // A special trick for comma operator for correct preprocessing #if defined BOOST_LAMBDA_COMMA_OPERATOR_NAME #error "Multiple defines of BOOST_LAMBDA_COMMA_OPERATOR_NAME" #endif #define BOOST_LAMBDA_COMMA_OPERATOR_NAME operator, BOOST_LAMBDA_BE1(BOOST_LAMBDA_COMMA_OPERATOR_NAME, other_action
, const A, const B, const_copy_argument) BOOST_LAMBDA_BE2(BOOST_LAMBDA_COMMA_OPERATOR_NAME, other_action
, const A, const B, const_copy_argument) BOOST_LAMBDA_BE3(BOOST_LAMBDA_COMMA_OPERATOR_NAME, other_action
, const A, const B, const_copy_argument) namespace detail { // special cases for ostream& << Any and istream& >> Any --------------- // the actual stream classes may vary and thus a specialisation for, // say ostream& does not match (the general case above is chosen). // Therefore we specialise for non-const reference: // if the left argument is a stream, we store the stream as reference // if it is something else, we store a const plain by default // Note that the overloading is const vs. non-const first argument #ifdef BOOST_NO_TEMPLATED_STREAMS template
struct convert_ostream_to_ref_others_to_c_plain_by_default { typedef typename detail::IF< boost::is_convertible
::value, T&, typename const_copy_argument
::type >::RET type; }; template
struct convert_istream_to_ref_others_to_c_plain_by_default { typedef typename detail::IF< boost::is_convertible
::value, T&, typename const_copy_argument
::type >::RET type; }; #else template
struct convert_ostream_to_ref_others_to_c_plain_by_default { typedef typename detail::IF< is_instance_of_2< T, std::basic_ostream >::value, T&, typename const_copy_argument
::type >::RET type; }; template
struct convert_istream_to_ref_others_to_c_plain_by_default { typedef typename detail::IF< is_instance_of_2< T, std::basic_istream >::value, T&, typename const_copy_argument
::type >::RET type; }; #endif } // detail BOOST_LAMBDA_BE2(operator<<, bitwise_action< leftshift_action>, A, const B, detail::convert_ostream_to_ref_others_to_c_plain_by_default) BOOST_LAMBDA_BE2(operator>>, bitwise_action< rightshift_action>, A, const B, detail::convert_istream_to_ref_others_to_c_plain_by_default) // special case for io_manipulators. // function references cannot be given as arguments to lambda operator // expressions in general. With << and >> the use of manipulators is // so common, that specializations are provided to make them work. template
inline const lambda_functor< lambda_functor_base< bitwise_action
, tuple
, Ret(&)(ManipArg)> > > operator<<(const lambda_functor
& a, Ret(&b)(ManipArg)) { return lambda_functor_base< bitwise_action
, tuple
, Ret(&)(ManipArg)> > ( tuple
, Ret(&)(ManipArg)>(a, b) ); } template
inline const lambda_functor< lambda_functor_base< bitwise_action
, tuple
, Ret(&)(ManipArg)> > > operator>>(const lambda_functor
& a, Ret(&b)(ManipArg)) { return lambda_functor_base< bitwise_action
, tuple
, Ret(&)(ManipArg)> > ( tuple
, Ret(&)(ManipArg)>(a, b) ); } // (+ and -) take their arguments as const references. // This has consquences with pointer artihmetic // E.g int a[]; ... *a = 1 works but not *(a+1) = 1. // the result of a+1 would be const // To make the latter work too, // non-const arrays are taken as non-const and stored as non-const as well. #if defined BOOST_LAMBDA_PTR_ARITHMETIC_E1 #error "Multiple defines of BOOST_LAMBDA_PTR_ARITHMETIC_E1" #endif #define BOOST_LAMBDA_PTR_ARITHMETIC_E1(OPER_NAME, ACTION, CONSTB) \ template
\ inline const \ lambda_functor< \ lambda_functor_base
, CONSTB(&)[N]> > \ > \ OPER_NAME (const lambda_functor
& a, CONSTB(&b)[N]) \ { \ return lambda_functor< \ lambda_functor_base
, CONSTB(&)[N]> > \ >(tuple
, CONSTB(&)[N]>(a, b)); \ } #if defined BOOST_LAMBDA_PTR_ARITHMETIC_E2 #error "Multiple defines of BOOST_LAMBDA_PTR_ARITHMETIC_E2" #endif #define BOOST_LAMBDA_PTR_ARITHMETIC_E2(OPER_NAME, ACTION, CONSTA) \ template
\ inline const \ lambda_functor< \ lambda_functor_base
> > \ > \ OPER_NAME (CONSTA(&a)[N], const lambda_functor
& b) \ { \ return \ lambda_functor_base
> > \ (tuple
>(a, b)); \ } BOOST_LAMBDA_PTR_ARITHMETIC_E1(operator+, arithmetic_action
, B) BOOST_LAMBDA_PTR_ARITHMETIC_E2(operator+, arithmetic_action
, A) BOOST_LAMBDA_PTR_ARITHMETIC_E1(operator+, arithmetic_action
,const B) BOOST_LAMBDA_PTR_ARITHMETIC_E2(operator+, arithmetic_action
,const A) //BOOST_LAMBDA_PTR_ARITHMETIC_E1(operator-, arithmetic_action
) // This is not needed, since the result of ptr-ptr is an rvalue anyway BOOST_LAMBDA_PTR_ARITHMETIC_E2(operator-, arithmetic_action
, A) BOOST_LAMBDA_PTR_ARITHMETIC_E2(operator-, arithmetic_action
, const A) #undef BOOST_LAMBDA_BE1 #undef BOOST_LAMBDA_BE2 #undef BOOST_LAMBDA_BE3 #undef BOOST_LAMBDA_BE #undef BOOST_LAMBDA_COMMA_OPERATOR_NAME #undef BOOST_LAMBDA_PTR_ARITHMETIC_E1 #undef BOOST_LAMBDA_PTR_ARITHMETIC_E2 // --------------------------------------------------------------------- // unary operators ----------------------------------------------------- // --------------------------------------------------------------------- #if defined BOOST_LAMBDA_UE #error "Multiple defines of BOOST_LAMBDA_UE" #endif #define BOOST_LAMBDA_UE(OPER_NAME, ACTION) \ template
\ inline const \ lambda_functor
> > > \ OPER_NAME (const lambda_functor
& a) \ { \ return \ lambda_functor_base
> > \ ( tuple
>(a) ); \ } BOOST_LAMBDA_UE(operator+, unary_arithmetic_action
) BOOST_LAMBDA_UE(operator-, unary_arithmetic_action
) BOOST_LAMBDA_UE(operator~, bitwise_action
) BOOST_LAMBDA_UE(operator!, logical_action
) BOOST_LAMBDA_UE(operator++, pre_increment_decrement_action
) BOOST_LAMBDA_UE(operator--, pre_increment_decrement_action
) BOOST_LAMBDA_UE(operator*, other_action
) BOOST_LAMBDA_UE(operator&, other_action
) #if defined BOOST_LAMBDA_POSTFIX_UE #error "Multiple defines of BOOST_LAMBDA_POSTFIX_UE" #endif #define BOOST_LAMBDA_POSTFIX_UE(OPER_NAME, ACTION) \ template
\ inline const \ lambda_functor
> > > \ OPER_NAME (const lambda_functor
& a, int) \ { \ return \ lambda_functor_base
> > \ ( tuple
>(a) ); \ } BOOST_LAMBDA_POSTFIX_UE(operator++, post_increment_decrement_action
) BOOST_LAMBDA_POSTFIX_UE(operator--, post_increment_decrement_action
) #undef BOOST_LAMBDA_UE #undef BOOST_LAMBDA_POSTFIX_UE } // namespace lambda } // namespace boost #endif
operators.hpp
Page URL
File URL
Prev
17/20
Next
Download
( 17 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.