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 Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000. // Use, modification and distribution are 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). // // See http://www.boost.org/libs/utility for most recent version including documentation. // compressed_pair: pair that "compresses" empty members // (see libs/utility/compressed_pair.htm) // // JM changes 25 Jan 2004: // For the case where T1 == T2 and both are empty, then first() and second() // should return different objects. // JM changes 25 Jan 2000: // Removed default arguments from compressed_pair_switch to get // C++ Builder 4 to accept them // rewriten swap to get gcc and C++ builder to compile. // added partial specialisations for case T1 == T2 to avoid duplicate constructor defs. #ifndef BOOST_DETAIL_COMPRESSED_PAIR_HPP #define BOOST_DETAIL_COMPRESSED_PAIR_HPP #include
#include
#include
#include
#include
#ifdef BOOST_MSVC # pragma warning(push) # pragma warning(disable:4512) #endif namespace boost { template
class compressed_pair; // compressed_pair namespace details { // JM altered 26 Jan 2000: template
struct compressed_pair_switch; template
struct compressed_pair_switch
{static const int value = 0;}; template
struct compressed_pair_switch
{static const int value = 3;}; template
struct compressed_pair_switch
{static const int value = 1;}; template
struct compressed_pair_switch
{static const int value = 2;}; template
struct compressed_pair_switch
{static const int value = 4;}; template
struct compressed_pair_switch
{static const int value = 5;}; template
class compressed_pair_imp; #ifdef __GNUC__ // workaround for GCC (JM): using std::swap; #endif // // can't call unqualified swap from within classname::swap // as Koenig lookup rules will find only the classname::swap // member function not the global declaration, so use cp_swap // as a forwarding function (JM): template
inline void cp_swap(T& t1, T& t2) { #ifndef __GNUC__ using std::swap; #endif swap(t1, t2); } // 0 derive from neither template
class compressed_pair_imp
{ public: typedef T1 first_type; typedef T2 second_type; typedef typename call_traits
::param_type first_param_type; typedef typename call_traits
::param_type second_param_type; typedef typename call_traits
::reference first_reference; typedef typename call_traits
::reference second_reference; typedef typename call_traits
::const_reference first_const_reference; typedef typename call_traits
::const_reference second_const_reference; compressed_pair_imp() {} compressed_pair_imp(first_param_type x, second_param_type y) : first_(x), second_(y) {} compressed_pair_imp(first_param_type x) : first_(x) {} compressed_pair_imp(second_param_type y) : second_(y) {} first_reference first() {return first_;} first_const_reference first() const {return first_;} second_reference second() {return second_;} second_const_reference second() const {return second_;} void swap(::boost::compressed_pair
& y) { cp_swap(first_, y.first()); cp_swap(second_, y.second()); } private: first_type first_; second_type second_; }; // 1 derive from T1 template
class compressed_pair_imp
: protected ::boost::remove_cv
::type { public: typedef T1 first_type; typedef T2 second_type; typedef typename call_traits
::param_type first_param_type; typedef typename call_traits
::param_type second_param_type; typedef typename call_traits
::reference first_reference; typedef typename call_traits
::reference second_reference; typedef typename call_traits
::const_reference first_const_reference; typedef typename call_traits
::const_reference second_const_reference; compressed_pair_imp() {} compressed_pair_imp(first_param_type x, second_param_type y) : first_type(x), second_(y) {} compressed_pair_imp(first_param_type x) : first_type(x) {} compressed_pair_imp(second_param_type y) : second_(y) {} first_reference first() {return *this;} first_const_reference first() const {return *this;} second_reference second() {return second_;} second_const_reference second() const {return second_;} void swap(::boost::compressed_pair
& y) { // no need to swap empty base class: cp_swap(second_, y.second()); } private: second_type second_; }; // 2 derive from T2 template
class compressed_pair_imp
: protected ::boost::remove_cv
::type { public: typedef T1 first_type; typedef T2 second_type; typedef typename call_traits
::param_type first_param_type; typedef typename call_traits
::param_type second_param_type; typedef typename call_traits
::reference first_reference; typedef typename call_traits
::reference second_reference; typedef typename call_traits
::const_reference first_const_reference; typedef typename call_traits
::const_reference second_const_reference; compressed_pair_imp() {} compressed_pair_imp(first_param_type x, second_param_type y) : second_type(y), first_(x) {} compressed_pair_imp(first_param_type x) : first_(x) {} compressed_pair_imp(second_param_type y) : second_type(y) {} first_reference first() {return first_;} first_const_reference first() const {return first_;} second_reference second() {return *this;} second_const_reference second() const {return *this;} void swap(::boost::compressed_pair
& y) { // no need to swap empty base class: cp_swap(first_, y.first()); } private: first_type first_; }; // 3 derive from T1 and T2 template
class compressed_pair_imp
: protected ::boost::remove_cv
::type, protected ::boost::remove_cv
::type { public: typedef T1 first_type; typedef T2 second_type; typedef typename call_traits
::param_type first_param_type; typedef typename call_traits
::param_type second_param_type; typedef typename call_traits
::reference first_reference; typedef typename call_traits
::reference second_reference; typedef typename call_traits
::const_reference first_const_reference; typedef typename call_traits
::const_reference second_const_reference; compressed_pair_imp() {} compressed_pair_imp(first_param_type x, second_param_type y) : first_type(x), second_type(y) {} compressed_pair_imp(first_param_type x) : first_type(x) {} compressed_pair_imp(second_param_type y) : second_type(y) {} first_reference first() {return *this;} first_const_reference first() const {return *this;} second_reference second() {return *this;} second_const_reference second() const {return *this;} // // no need to swap empty bases: void swap(::boost::compressed_pair
&) {} }; // JM // 4 T1 == T2, T1 and T2 both empty // Originally this did not store an instance of T2 at all // but that led to problems beause it meant &x.first() == &x.second() // which is not true for any other kind of pair, so now we store an instance // of T2 just in case the user is relying on first() and second() returning // different objects (albeit both empty). template
class compressed_pair_imp
: protected ::boost::remove_cv
::type { public: typedef T1 first_type; typedef T2 second_type; typedef typename call_traits
::param_type first_param_type; typedef typename call_traits
::param_type second_param_type; typedef typename call_traits
::reference first_reference; typedef typename call_traits
::reference second_reference; typedef typename call_traits
::const_reference first_const_reference; typedef typename call_traits
::const_reference second_const_reference; compressed_pair_imp() {} compressed_pair_imp(first_param_type x, second_param_type y) : first_type(x), m_second(y) {} compressed_pair_imp(first_param_type x) : first_type(x), m_second(x) {} first_reference first() {return *this;} first_const_reference first() const {return *this;} second_reference second() {return m_second;} second_const_reference second() const {return m_second;} void swap(::boost::compressed_pair
&) {} private: T2 m_second; }; // 5 T1 == T2 and are not empty: //JM template
class compressed_pair_imp
{ public: typedef T1 first_type; typedef T2 second_type; typedef typename call_traits
::param_type first_param_type; typedef typename call_traits
::param_type second_param_type; typedef typename call_traits
::reference first_reference; typedef typename call_traits
::reference second_reference; typedef typename call_traits
::const_reference first_const_reference; typedef typename call_traits
::const_reference second_const_reference; compressed_pair_imp() {} compressed_pair_imp(first_param_type x, second_param_type y) : first_(x), second_(y) {} compressed_pair_imp(first_param_type x) : first_(x), second_(x) {} first_reference first() {return first_;} first_const_reference first() const {return first_;} second_reference second() {return second_;} second_const_reference second() const {return second_;} void swap(::boost::compressed_pair
& y) { cp_swap(first_, y.first()); cp_swap(second_, y.second()); } private: first_type first_; second_type second_; }; } // details template
class compressed_pair : private ::boost::details::compressed_pair_imp
::type, typename remove_cv
::type>::value, ::boost::is_empty
::value, ::boost::is_empty
::value>::value> { private: typedef details::compressed_pair_imp
::type, typename remove_cv
::type>::value, ::boost::is_empty
::value, ::boost::is_empty
::value>::value> base; public: typedef T1 first_type; typedef T2 second_type; typedef typename call_traits
::param_type first_param_type; typedef typename call_traits
::param_type second_param_type; typedef typename call_traits
::reference first_reference; typedef typename call_traits
::reference second_reference; typedef typename call_traits
::const_reference first_const_reference; typedef typename call_traits
::const_reference second_const_reference; compressed_pair() : base() {} compressed_pair(first_param_type x, second_param_type y) : base(x, y) {} explicit compressed_pair(first_param_type x) : base(x) {} explicit compressed_pair(second_param_type y) : base(y) {} first_reference first() {return base::first();} first_const_reference first() const {return base::first();} second_reference second() {return base::second();} second_const_reference second() const {return base::second();} void swap(compressed_pair& y) { base::swap(y); } }; // JM // Partial specialisation for case where T1 == T2: // template
class compressed_pair
: private details::compressed_pair_imp
::type, typename remove_cv
::type>::value, ::boost::is_empty
::value, ::boost::is_empty
::value>::value> { private: typedef details::compressed_pair_imp
::type, typename remove_cv
::type>::value, ::boost::is_empty
::value, ::boost::is_empty
::value>::value> base; public: typedef T first_type; typedef T second_type; typedef typename call_traits
::param_type first_param_type; typedef typename call_traits
::param_type second_param_type; typedef typename call_traits
::reference first_reference; typedef typename call_traits
::reference second_reference; typedef typename call_traits
::const_reference first_const_reference; typedef typename call_traits
::const_reference second_const_reference; compressed_pair() : base() {} compressed_pair(first_param_type x, second_param_type y) : base(x, y) {} #if !(defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x530)) explicit #endif compressed_pair(first_param_type x) : base(x) {} first_reference first() {return base::first();} first_const_reference first() const {return base::first();} second_reference second() {return base::second();} second_const_reference second() const {return base::second();} void swap(::boost::compressed_pair
& y) { base::swap(y); } }; template
inline void swap(compressed_pair
& x, compressed_pair
& y) { x.swap(y); } } // boost #ifdef BOOST_MSVC # pragma warning(pop) #endif #endif // BOOST_DETAIL_COMPRESSED_PAIR_HPP
compressed_pair.hpp
Page URL
File URL
Prev
14/61
Next
Download
( 16 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.