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 2002-2007, Fernando Luis Cacciola Carballal. // // 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) // // 21 Ago 2002 (Created) Fernando Cacciola // 24 Dec 2007 (Refactored and worked around various compiler bugs) Fernando Cacciola, Niels Dekker // #ifndef BOOST_UTILITY_VALUE_INIT_21AGO2002_HPP #define BOOST_UTILITY_VALUE_INIT_21AGO2002_HPP // Note: The implementation of boost::value_initialized had to deal with the // fact that various compilers haven't fully implemented value-initialization: // Microsoft Feedback ID 100744 - Value-initialization in new-expression // Reported by Pavel Kuznetsov (MetaCommunications Engineering), 2005-07-28 // https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=100744 // GCC Bug 30111 - Value-initialization of POD base class doesn't initialize members // Reported by Jonathan Wakely, 2006-12-07 // http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30111 // GCC Bug 33916 - Default constructor fails to initialize array members // Reported by Michael Elizabeth Chastain, 2007-10-26 // http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33916 // Borland Report 51854 - Value-initialization: POD struct should be zero-initialized // Reported by Niels Dekker (LKEB, Leiden University Medical Center), 2007-11-09 // http://qc.codegear.com/wc/qcmain.aspx?d=51854 // The constructor of boost::value_initialized
works around these issues, by // clearing the bytes of T, before constructing the T object it contains. #include
#include
#include
#include
#include
#include
namespace boost { template
class value_initialized { private : struct wrapper { #if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x592)) typename #endif remove_const
::type data; }; mutable aligned_storage
::value> x; public : value_initialized() { std::memset(x.address(), 0, sizeof(x)); #ifdef BOOST_MSVC #pragma warning(push) #if _MSC_VER >= 1310 // When using MSVC 7.1 or higher, the following placement new expression may trigger warning C4345: // "behavior change: an object of POD type constructed with an initializer of the form () // will be default-initialized". There is no need to worry about this, though. #pragma warning(disable: 4345) #endif #endif new (x.address()) wrapper(); #ifdef BOOST_MSVC #pragma warning(pop) #endif } value_initialized(value_initialized const & arg) { new (x.address()) wrapper( *static_cast
(arg.x.address()) ); } value_initialized & operator=(value_initialized const & arg) { T & this_data = this->data(); T const & arg_data = arg.data(); this_data = arg_data; return *this; } ~value_initialized() { static_cast
(x.address())->wrapper::~wrapper(); } T& data() const { return static_cast
(x.address())->data; } operator T&() const { return this->data(); } } ; template
T const& get ( value_initialized
const& x ) { return x.data() ; } template
T& get ( value_initialized
& x ) { return x.data() ; } } // namespace boost #endif
value_init.hpp
Page URL
File URL
Prev
8/8 Next
Download
( 3 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.