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 Thorsten Ottosen 2005. // (C) Copyright Jonathan Turkanis 2004. // (C) Copyright Daniel Wallin 2004. // 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.) // Implementation of the move_ptr from the "Move Proposal" // (http://std.dkuug.dk/jtc1/sc22/wg21/docs/papers/2002/n1377.htm) // enhanced to support custom deleters and safe boolean conversions. // // The implementation is based on an implementation by Daniel Wallin, at // "http://aspn.activestate.com/ASPN/Mail/Message/Attachments/boost/ // 400DC271.1060903@student.umu.se/move_ptr.hpp". The current was adapted // by Jonathan Turkanis to incorporating ideas of Howard Hinnant and // Rani Sharoni. #ifndef BOOST_STATIC_MOVE_PTR_HPP_INCLUDED #define BOOST_STATIC_MOVE_PTR_HPP_INCLUDED #include
// Member template friends, put size_t in std. #include
// size_t #include
#include
#include
#include
#include
#include
#include
#if defined(BOOST_MSVC) #pragma warning(push) #pragma warning(disable:4521) // Multiple copy constuctors. #endif namespace boost { namespace ptr_container_detail { template< typename T, typename Deleter = move_ptrs::default_deleter
> class static_move_ptr { public: typedef typename remove_bounds
::type element_type; typedef Deleter deleter_type; private: struct safe_bool_helper { int x; }; typedef int safe_bool_helper::* safe_bool; typedef boost::compressed_pair
impl_type; public: typedef typename impl_type::second_reference deleter_reference; typedef typename impl_type::second_const_reference deleter_const_reference; // Constructors static_move_ptr() : impl_(0) { } static_move_ptr(const static_move_ptr& p) : impl_(p.get(), p.get_deleter()) { const_cast
(p).release(); } #if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) static_move_ptr( const move_ptrs::move_source
>& src ) #else static_move_ptr( const move_ptrs::move_source
& src ) #endif : impl_(src.ptr().get(), src.ptr().get_deleter()) { src.ptr().release(); } template
explicit static_move_ptr(TT* tt) : impl_(tt, Deleter()) { } // Destructor ~static_move_ptr() { if (ptr()) get_deleter()(ptr()); } // Assignment static_move_ptr& operator=(static_move_ptr rhs) { rhs.swap(*this); return *this; } // Smart pointer interface element_type* get() const { return ptr(); } element_type& operator*() { /*BOOST_STATIC_ASSERT(!is_array);*/ return *ptr(); } const element_type& operator*() const { /*BOOST_STATIC_ASSERT(!is_array);*/ return *ptr(); } element_type* operator->() { /*BOOST_STATIC_ASSERT(!is_array);*/ return ptr(); } const element_type* operator->() const { /*BOOST_STATIC_ASSERT(!is_array);*/ return ptr(); } element_type* release() { element_type* result = ptr(); ptr() = 0; return result; } void reset() { if (ptr()) get_deleter()(ptr()); ptr() = 0; } template
void reset(TT* tt) { static_move_ptr(tt).swap(*this); } template
void reset(TT* tt, DD dd) { static_move_ptr(tt, dd).swap(*this); } operator safe_bool() const { return ptr() ? &safe_bool_helper::x : 0; } void swap(static_move_ptr& p) { impl_.swap(p.impl_); } deleter_reference get_deleter() { return impl_.second(); } deleter_const_reference get_deleter() const { return impl_.second(); } private: template
void check(const static_move_ptr
& ptr) { typedef move_ptrs::is_smart_ptr_convertible
convertible; BOOST_STATIC_ASSERT(convertible::value); } #if defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING) || defined(BOOST_NO_SFINAE) // give up on this behavior #else template
struct cant_move_from_const; template
struct cant_move_from_const< const static_move_ptr
> { typedef typename static_move_ptr
::error type; }; template
static_move_ptr(Ptr&, typename cant_move_from_const
::type = 0); public: static_move_ptr(static_move_ptr&); private: template
static_move_ptr( static_move_ptr
&, typename move_ptrs::enable_if_convertible< TT, T, static_move_ptr& >::type::type* = 0 ); #endif // BOOST_NO_FUNCTION_TEMPLATE_ORDERING || BOOST_NO_SFINAE //#ifndef BOOST_NO_MEMBER_TEMPLATE_FRIENDS // template
// friend class static_move_ptr; //#else public: //#endif typename impl_type::first_reference ptr() { return impl_.first(); } typename impl_type::first_const_reference ptr() const { return impl_.first(); } impl_type impl_; }; } // namespace ptr_container_detail } // End namespace boost. #if defined(BOOST_MSVC) #pragma warning(pop) // #pragma warning(disable:4251) #endif #endif // #ifndef BOOST_STATIC_MOVE_PTR_HPP_INCLUDED
static_move_ptr.hpp
Page URL
File URL
Prev
11/13
Next
Download
( 6 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.