Beispiel #1
0
    initialized()
    {
#if BOOST_DETAIL_VALUE_INIT_WORKAROUND
      std::memset(&x, 0, sizeof(x));
#endif
      new (wrapper_address()) wrapper();
    }
 value_initialized & operator=(value_initialized const & arg)
 {
   // Assignment is only allowed when T is non-const.
   BOOST_STATIC_ASSERT( ! is_const<T>::value );
   *wrapper_address() = static_cast<wrapper const &>(*(arg.wrapper_address()));
   return *this;
 }
    value_initialized()
    {
      std::memset(&x, 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".  It is safe to ignore this warning when using value_initialized.
#pragma warning(disable: 4345)
#endif
#endif
      new (wrapper_address()) wrapper();
#ifdef BOOST_MSVC
#pragma warning(pop)
#endif
    }
 value_initialized(value_initialized const & arg)
 {
   new (wrapper_address()) wrapper( static_cast<wrapper const &>(*(arg.wrapper_address())));
 }
Beispiel #5
0
 operator T&()
 {
   return wrapper_address()->data;
 }
Beispiel #6
0
 operator T const &() const
 {
   return wrapper_address()->data;
 }
Beispiel #7
0
 T& data()
 {
   return wrapper_address()->data;
 }
Beispiel #8
0
 BOOST_GPU_ENABLED
 explicit initialized(T const & arg)
 {
   new (wrapper_address()) wrapper(arg);
 }
Beispiel #9
0
 BOOST_GPU_ENABLED
 operator T const &() const
 {
   return wrapper_address()->data;
 }
Beispiel #10
0
 BOOST_GPU_ENABLED
 operator T&()
 {
   return wrapper_address()->data;
 }
Beispiel #11
0
 BOOST_GPU_ENABLED
 T& data()
 {
   return wrapper_address()->data;
 }
Beispiel #12
0
 BOOST_GPU_ENABLED
 T const & data() const
 {
   return wrapper_address()->data;
 }
Beispiel #13
0
 BOOST_GPU_ENABLED
 ~initialized()
 {
   wrapper_address()->wrapper::~wrapper();
 }
 ~value_initialized()
 {
   wrapper_address()->wrapper::~wrapper();
 }
Beispiel #15
0
 explicit initialized(T const & arg)
 {
   new (wrapper_address()) wrapper(arg);
 }
 T& data() const
 {
   return wrapper_address()->data;
 }
Beispiel #17
0
 BOOST_GPU_ENABLED
 initialized(initialized const & arg)
 {
   new (wrapper_address()) wrapper( static_cast<wrapper const &>(*(arg.wrapper_address())));
 }