forked from boostorg/utility
Merged revisions 41161-41246 via svnmerge from
https://svn.boost.org/svn/boost/trunk ........ r41161 | bemandawes | 2007-11-16 15:21:47 -0800 (Fri, 16 Nov 2007) | 1 line Fix markup error ........ r41163 | bgubenko | 2007-11-16 17:28:10 -0800 (Fri, 16 Nov 2007) | 1 line mark some fusion library tests for acc toolset ........ r41164 | djowel | 2007-11-16 17:51:04 -0800 (Fri, 16 Nov 2007) | 1 line fix for trac ticket #1450 ........ r41165 | lbourdev | 2007-11-16 19:38:25 -0800 (Fri, 16 Nov 2007) | 10 lines Updated to version 2.1.2 Added support for more compilers. Added new flag GIL_NONWORD_POINTER_ALIGNMENT_SUPPORTED to indicate whether dereferencing on non-word boundary is supported. Enabling this flag improves performance. Fixed two bugs related to non-byte-aligned images. The image alignment parameter is now specified in bytes, and has a default of 0, which means "packed" alignment. In particular, for non-byte-aligned images alignment of 0 means there are no padding bits at the ends of rows. Added the allocator as an optional parameter to image constructors and image recreate methods. ........ r41167 | grafik | 2007-11-16 20:11:49 -0800 (Fri, 16 Nov 2007) | 1 line Add "--out-xml=xyz.xml" option that dumps the output of all actions, and the test.jam information, to the given file. Changes are mostly from Dave. ........ r41169 | johnmaddock | 2007-11-17 02:00:43 -0800 (Sat, 17 Nov 2007) | 1 line Ooops, check on wrong index, now fixed. ........ r41170 | johnmaddock | 2007-11-17 04:17:05 -0800 (Sat, 17 Nov 2007) | 1 line Fix WinCE issues. ........ r41172 | johnmaddock | 2007-11-17 10:41:29 -0800 (Sat, 17 Nov 2007) | 1 line Changed test to catch throw exceptions from thread creation. ........ r41173 | bemandawes | 2007-11-17 12:13:16 -0800 (Sat, 17 Nov 2007) | 1 line // Add or correct comment identifying Boost library this header is associated with. ........ r41174 | grafik | 2007-11-17 12:14:24 -0800 (Sat, 17 Nov 2007) | 1 line Add in Dave's comments, and expand information in XML output to include action names, sources, properties, bjam info, and platform info. This required one minor change to actions to keep track of the action object generating the targets. ........ r41175 | nesotto | 2007-11-17 12:22:05 -0800 (Sat, 17 Nov 2007) | 1 line minor update of comments ........ r41176 | nesotto | 2007-11-17 12:22:20 -0800 (Sat, 17 Nov 2007) | 1 line last updates ........ r41177 | nesotto | 2007-11-17 12:44:29 -0800 (Sat, 17 Nov 2007) | 1 line works after local test with vc8 ........ r41178 | nesotto | 2007-11-17 13:02:22 -0800 (Sat, 17 Nov 2007) | 1 line added missing header ........ r41180 | nesotto | 2007-11-17 13:19:13 -0800 (Sat, 17 Nov 2007) | 1 line iostream macro patch ........ r41181 | nesotto | 2007-11-17 13:21:53 -0800 (Sat, 17 Nov 2007) | 1 line removed some warnings ........ r41182 | grafik | 2007-11-17 13:22:40 -0800 (Sat, 17 Nov 2007) | 1 line Add working dir to build description, move jam version to an attribute. ........ r41183 | nesotto | 2007-11-17 13:24:16 -0800 (Sat, 17 Nov 2007) | 1 line macro patch ........ r41185 | nesotto | 2007-11-17 13:43:32 -0800 (Sat, 17 Nov 2007) | 1 line minor change to define the value type of the iterators better ........ r41186 | grafik | 2007-11-17 14:09:26 -0800 (Sat, 17 Nov 2007) | 1 line Change "actual" to the more natural "target", and change "target" to "path". Add bjam command and bb version to XML. ........ r41187 | bemandawes | 2007-11-17 14:48:06 -0800 (Sat, 17 Nov 2007) | 1 line Add or correct comment identifying Boost library this header is associated with. ........ r41188 | andreas_huber69 | 2007-11-17 16:08:46 -0800 (Sat, 17 Nov 2007) | 1 line Added markup for statechart failures on msvc-8.0~wm5~stlport5.1 ........ r41192 | grafik | 2007-11-17 22:42:14 -0800 (Sat, 17 Nov 2007) | 1 line Add to XML output the known targets and dependencies to allow creation of the full build dependency graph. Merge from Dave's Bitten branch. ........ r41193 | johnmaddock | 2007-11-18 02:07:14 -0800 (Sun, 18 Nov 2007) | 1 line Ooops: previous commit broke platforms/compilers with no long double support, added workaround as fix. ........ r41194 | igaztanaga | 2007-11-18 02:41:57 -0800 (Sun, 18 Nov 2007) | 1 line Interprocess changes to support systems with filesystem-based shared memory ........ r41195 | igaztanaga | 2007-11-18 02:43:35 -0800 (Sun, 18 Nov 2007) | 1 line Added scapegoat trees and an option to store the hash value in the hook for unordered containers ........ r41196 | igaztanaga | 2007-11-18 02:44:56 -0800 (Sun, 18 Nov 2007) | 1 line Added scapegoat trees and an option to store the hash value in the hook for unordered containers ........ r41197 | igaztanaga | 2007-11-18 02:51:19 -0800 (Sun, 18 Nov 2007) | 1 line Interprocess changes to support systems with filesystem-based shared memory ........ r41198 | igaztanaga | 2007-11-18 02:54:48 -0800 (Sun, 18 Nov 2007) | 1 line Interprocess changes to support systems with filesystem-based shared memory ........ r41199 | johnmaddock | 2007-11-18 04:23:37 -0800 (Sun, 18 Nov 2007) | 1 line Added missing template argument to specialisations. ........ r41200 | johnmaddock | 2007-11-18 04:24:42 -0800 (Sun, 18 Nov 2007) | 1 line Fix IMB xlc error limits, added workarounds where these were missed by the last commit. ........ r41201 | t_schwinger | 2007-11-18 06:06:47 -0800 (Sun, 18 Nov 2007) | 3 lines adds comment to fusion aCC failure markup ........ r41202 | danieljames | 2007-11-18 08:10:12 -0800 (Sun, 18 Nov 2007) | 2 lines Move the instructions for running regression tests to the new site. Fixes #1265. ........ r41210 | danieljames | 2007-11-18 12:18:04 -0800 (Sun, 18 Nov 2007) | 2 lines Move the 'implementation variations' page to the new site. Fixes #1355. ........ r41211 | eric_niebler | 2007-11-18 12:19:55 -0800 (Sun, 18 Nov 2007) | 1 line vc6 doesn't like BOOST_MPL_ASSERT_MSG ........ r41212 | grafik | 2007-11-18 12:24:25 -0800 (Sun, 18 Nov 2007) | 1 line Inspection report fixes. ........ r41213 | grafik | 2007-11-18 12:53:28 -0800 (Sun, 18 Nov 2007) | 1 line Cleanup tools/regression to remove obsolete runner scripts, move existing docs to doc subdir, and clean html docs into valid xhtml. ........ r41214 | grafik | 2007-11-18 13:02:51 -0800 (Sun, 18 Nov 2007) | 1 line Add missing <cstring> include, for std::strchr function. ........ r41215 | grafik | 2007-11-18 13:07:26 -0800 (Sun, 18 Nov 2007) | 1 line Add keyword tags. ........ r41216 | niels_dekker | 2007-11-18 14:11:57 -0800 (Sun, 18 Nov 2007) | 1 line Code refactoring: removed private base classes of value_initialized, as suggested by Fernando Cacciola. ........ r41217 | djowel | 2007-11-18 16:05:43 -0800 (Sun, 18 Nov 2007) | 1 line added link to docs ........ r41218 | johnmaddock | 2007-11-19 02:02:16 -0800 (Mon, 19 Nov 2007) | 1 line Oops: added missing template specialisation argument. ........ r41219 | johnmaddock | 2007-11-19 02:20:36 -0800 (Mon, 19 Nov 2007) | 1 line No user32.lib on WinCE ........ r41220 | joaquin | 2007-11-19 03:08:11 -0800 (Mon, 19 Nov 2007) | 1 line moved some ADL stuff out of a potentially name-hiding scope ........ r41221 | troyer | 2007-11-19 04:15:58 -0800 (Mon, 19 Nov 2007) | 1 line made complex seriaqlization more portable ........ r41222 | anthonyw | 2007-11-19 04:17:31 -0800 (Mon, 19 Nov 2007) | 1 line fixed TSS cleanup on 64-bit Windows ........ r41223 | anthonyw | 2007-11-19 04:29:14 -0800 (Mon, 19 Nov 2007) | 1 line fixed problems with TSS cleanup when using LoadLibrary and when threads finish after thread_specific_ptr instance has been destroyed ........ r41224 | garcia | 2007-11-19 05:28:00 -0800 (Mon, 19 Nov 2007) | 2 lines A bunch of review volunteers. ........ r41225 | garcia | 2007-11-19 06:01:34 -0800 (Mon, 19 Nov 2007) | 2 lines Added boost.range update ........ r41226 | anthonyw | 2007-11-19 06:29:22 -0800 (Mon, 19 Nov 2007) | 1 line added copyright ........ r41227 | aaron_windsor | 2007-11-19 07:28:26 -0800 (Mon, 19 Nov 2007) | 1 line Cleaning up #includes to avoid errors on gcc 4.1 and above. ........ r41234 | igaztanaga | 2007-11-19 08:55:23 -0800 (Mon, 19 Nov 2007) | 1 line Fixed errors detected by gcc-4.3 ........ r41235 | hljin | 2007-11-19 09:26:12 -0800 (Mon, 19 Nov 2007) | 1 line GIL: updated the design guide based on the new changes ........ r41236 | grafik | 2007-11-19 09:44:31 -0800 (Mon, 19 Nov 2007) | 1 line Make quietly actions really quiet by not printing the command output. The output for the quietly actions is still available through "__ACTION_RULE__". ........ r41237 | grafik | 2007-11-19 10:02:43 -0800 (Mon, 19 Nov 2007) | 1 line Add architecture and instruction-set values for HP/PA-RISC. ........ r41238 | igaztanaga | 2007-11-19 10:09:13 -0800 (Mon, 19 Nov 2007) | 1 line Corrected ifdef ........ r41240 | igaztanaga | 2007-11-19 10:32:12 -0800 (Mon, 19 Nov 2007) | 1 line Fixed 64 bit std::size_t specialization error ........ r41241 | hljin | 2007-11-19 10:34:59 -0800 (Mon, 19 Nov 2007) | 1 line GIL: broke the main test into small tests ........ r41242 | bgubenko | 2007-11-19 11:25:21 -0800 (Mon, 19 Nov 2007) | 1 line add OSPLAT=PARISC for HP-UX PA-RISC ........ [SVN r41247]
This commit is contained in:
@ -6,6 +6,7 @@
|
||||
//
|
||||
// 21 Ago 2002 (Created) Fernando Cacciola
|
||||
// 07 Set 2007 (Worked around MSVC++ bug) Fernando Cacciola, Niels Dekker
|
||||
// 16 Nov 2007 (Refactoring: removed private base classes) Fernando Cacciola, Niels Dekker
|
||||
//
|
||||
#ifndef BOOST_UTILITY_VALUE_INIT_21AGO2002_HPP
|
||||
#define BOOST_UTILITY_VALUE_INIT_21AGO2002_HPP
|
||||
@ -14,7 +15,6 @@
|
||||
#include <boost/type_traits/cv_traits.hpp>
|
||||
#include <boost/detail/workaround.hpp>
|
||||
|
||||
#if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1500) )
|
||||
// Microsoft Visual C++ does not correctly support value initialization, as reported by
|
||||
// Pavel Kuznetsov (MetaCommunications Engineering), 7/28/2005, Feedback ID 100744,
|
||||
// Feedback Title: Value-initialization in new-expression
|
||||
@ -22,10 +22,12 @@
|
||||
// The report was closed at 11/14/2006, and its status was set to "Closed (Won't Fix)".
|
||||
// Luckily, even in the presence of this compiler bug, boost::value_initialized will still
|
||||
// do its job correctly, when using the following workaround:
|
||||
#define BOOST_UTILITY_VALUE_INIT_WORKAROUND
|
||||
#if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1500))
|
||||
# define BOOST_UTILITY_VALUE_INIT_WORKAROUND
|
||||
#endif
|
||||
|
||||
#ifdef BOOST_UTILITY_VALUE_INIT_WORKAROUND
|
||||
|
||||
#include <boost/aligned_storage.hpp>
|
||||
#include <boost/type_traits/alignment_of.hpp>
|
||||
#include <cstring>
|
||||
@ -43,60 +45,34 @@
|
||||
|
||||
namespace boost {
|
||||
|
||||
namespace vinit_detail {
|
||||
|
||||
template<class T>
|
||||
class const_T_base
|
||||
class value_initialized
|
||||
{
|
||||
protected :
|
||||
|
||||
const_T_base()
|
||||
{
|
||||
std::memset(&x, 0, sizeof(x));
|
||||
new (&x) T();
|
||||
}
|
||||
|
||||
~const_T_base()
|
||||
{
|
||||
void const * ptr = &x;
|
||||
static_cast<T*>(ptr)->T::~T();
|
||||
}
|
||||
|
||||
T & get() const
|
||||
{
|
||||
void const * ptr = &x;
|
||||
return *static_cast<T*>(ptr);
|
||||
}
|
||||
|
||||
private :
|
||||
typename ::boost::aligned_storage<sizeof(T), ::boost::alignment_of<T>::value>::type x;
|
||||
} ;
|
||||
|
||||
template<class T>
|
||||
class non_const_T_base
|
||||
{
|
||||
protected :
|
||||
|
||||
non_const_T_base()
|
||||
{
|
||||
std::memset(&x, 0, sizeof(x));
|
||||
new (&x) T();
|
||||
}
|
||||
|
||||
~non_const_T_base()
|
||||
{
|
||||
void * ptr = &x;
|
||||
static_cast<T*>(ptr)->T::~T();
|
||||
}
|
||||
|
||||
T & get() const
|
||||
{
|
||||
void * ptr = &x;
|
||||
return *static_cast<T*>(ptr);
|
||||
}
|
||||
|
||||
private :
|
||||
mutable typename ::boost::aligned_storage<sizeof(T), ::boost::alignment_of<T>::value>::type x;
|
||||
|
||||
public :
|
||||
|
||||
value_initialized()
|
||||
{
|
||||
std::memset(&x, 0, sizeof(x));
|
||||
new (&x) T();
|
||||
}
|
||||
|
||||
~value_initialized()
|
||||
{
|
||||
void * ptr = &x;
|
||||
static_cast<T*>(ptr)->T::~T();
|
||||
}
|
||||
|
||||
T& data() const
|
||||
{
|
||||
void * ptr = &x;
|
||||
return *static_cast<T*>(ptr);
|
||||
}
|
||||
|
||||
operator T&() const { return this->data(); }
|
||||
|
||||
} ;
|
||||
|
||||
#ifdef BOOST_MSVC
|
||||
@ -108,59 +84,27 @@ class non_const_T_base
|
||||
|
||||
namespace boost {
|
||||
|
||||
namespace vinit_detail {
|
||||
|
||||
template<class T>
|
||||
class const_T_base
|
||||
{
|
||||
protected :
|
||||
|
||||
const_T_base() : x() {}
|
||||
T & get() const { return x; }
|
||||
|
||||
private :
|
||||
T x ;
|
||||
} ;
|
||||
|
||||
template<class T>
|
||||
class non_const_T_base
|
||||
{
|
||||
protected :
|
||||
|
||||
non_const_T_base() : x() {}
|
||||
T & get() const { return x; }
|
||||
|
||||
private :
|
||||
mutable T x ;
|
||||
} ;
|
||||
|
||||
#endif
|
||||
|
||||
template<class T>
|
||||
struct select_base
|
||||
{
|
||||
typedef
|
||||
#if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
|
||||
typename
|
||||
#endif
|
||||
::boost::detail::if_true< ::boost::is_const<T>::value >
|
||||
::template then< const_T_base<T>, non_const_T_base<T> >::type type ;
|
||||
} ;
|
||||
|
||||
} // namespace vinit_detail
|
||||
|
||||
template<class T>
|
||||
class value_initialized : private vinit_detail::select_base<T>::type
|
||||
class value_initialized
|
||||
{
|
||||
public :
|
||||
|
||||
value_initialized() {}
|
||||
value_initialized() : x() {}
|
||||
|
||||
operator T&() const { return this->get(); }
|
||||
T& data() const { return x; }
|
||||
|
||||
T& data() const { return this->get(); }
|
||||
operator T&() const { return this->data(); }
|
||||
|
||||
mutable
|
||||
#if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
|
||||
typename
|
||||
#endif
|
||||
::boost::remove_const<T>::type x ;
|
||||
|
||||
} ;
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
template<class T>
|
||||
T const& get ( value_initialized<T> const& x )
|
||||
@ -177,4 +121,3 @@ T& get ( value_initialized<T>& x )
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
Reference in New Issue
Block a user