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 variant/get.hpp header file // See http://www.boost.org for updates, documentation, and revision history. //----------------------------------------------------------------------------- // // Copyright (c) 2003 // Eric Friedman, Itay Maman // // 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) #ifndef BOOST_VARIANT_GET_HPP #define BOOST_VARIANT_GET_HPP #include
#include "boost/config.hpp" #include "boost/detail/workaround.hpp" #include "boost/utility/addressof.hpp" #include "boost/variant/variant_fwd.hpp" #include "boost/type_traits/add_reference.hpp" #include "boost/type_traits/add_pointer.hpp" #if BOOST_WORKAROUND(BOOST_MSVC, < 1300) # include "boost/mpl/bool.hpp" # include "boost/mpl/or.hpp" # include "boost/type_traits/is_same.hpp" #endif namespace boost { ////////////////////////////////////////////////////////////////////////// // class bad_get // // The exception thrown in the event of a failed get of a value. // class bad_get : public std::exception { public: // std::exception implementation virtual const char * what() const throw() { return "boost::bad_get: " "failed value get using boost::get"; } }; ////////////////////////////////////////////////////////////////////////// // function template get
// // Retrieves content of given variant object if content is of type T. // Otherwise: pointer ver. returns 0; reference ver. throws bad_get. // namespace detail { namespace variant { // (detail) class template get_visitor // // Generic static visitor that: if the value is of the specified type, // returns a pointer to the value it visits; else a null pointer. // template
struct get_visitor { private: // private typedefs typedef typename add_pointer
::type pointer; typedef typename add_reference
::type reference; public: // visitor typedefs typedef pointer result_type; public: // visitor interfaces #if !BOOST_WORKAROUND(BOOST_MSVC, < 1300) pointer operator()(reference operand) const { return boost::addressof(operand); } template
pointer operator()(const U&) const { return static_cast
(0); } #else // MSVC6 private: // helpers, for visitor interfaces (below) pointer execute_impl(reference operand, mpl::true_) const { return boost::addressof(operand); } template
pointer execute_impl(const U& operand, mpl::false_) const { return static_cast
(0); } public: // visitor interfaces template
pointer operator()(U& operand) const { // MSVC6 finds normal implementation (above) ambiguous, // so we must explicitly disambiguate typedef typename mpl::or_< is_same
, is_same
>::type U_is_T; return execute_impl(operand, U_is_T()); } #endif // MSVC6 workaround }; }} // namespace detail::variant #if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x0551)) # define BOOST_VARIANT_AUX_GET_EXPLICIT_TEMPLATE_TYPE(t) \ BOOST_APPEND_EXPLICIT_TEMPLATE_TYPE(t) #else # define BOOST_VARIANT_AUX_GET_EXPLICIT_TEMPLATE_TYPE(t) \ , t* = 0 #endif template
inline typename add_pointer
::type get( boost::variant< BOOST_VARIANT_ENUM_PARAMS(T) >* operand BOOST_VARIANT_AUX_GET_EXPLICIT_TEMPLATE_TYPE(U) ) { typedef typename add_pointer
::type U_ptr; if (!operand) return static_cast
(0); detail::variant::get_visitor
v; return operand->apply_visitor(v); } template
inline typename add_pointer
::type get( const boost::variant< BOOST_VARIANT_ENUM_PARAMS(T) >* operand BOOST_VARIANT_AUX_GET_EXPLICIT_TEMPLATE_TYPE(U) ) { typedef typename add_pointer
::type U_ptr; if (!operand) return static_cast
(0); detail::variant::get_visitor
v; return operand->apply_visitor(v); } template
inline typename add_reference
::type get( boost::variant< BOOST_VARIANT_ENUM_PARAMS(T) >& operand BOOST_VARIANT_AUX_GET_EXPLICIT_TEMPLATE_TYPE(U) ) { typedef typename add_pointer
::type U_ptr; U_ptr result = get
(&operand); if (!result) throw bad_get(); return *result; } template
inline typename add_reference
::type get( const boost::variant< BOOST_VARIANT_ENUM_PARAMS(T) >& operand BOOST_VARIANT_AUX_GET_EXPLICIT_TEMPLATE_TYPE(U) ) { typedef typename add_pointer
::type U_ptr; U_ptr result = get
(&operand); if (!result) throw bad_get(); return *result; } } // namespace boost #endif // BOOST_VARIANT_GET_HPP
get.hpp
Page URL
File URL
Prev
3/10
Next
Download
( 5 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.