mirror of
https://github.com/boostorg/optional.git
synced 2025-07-24 09:37:27 +02:00
Compare commits
1 Commits
pr/unquali
...
pr/aligned
Author | SHA1 | Date | |
---|---|---|---|
ec96129e9e |
@ -28,7 +28,7 @@ class aligned_storage
|
||||
// BOOST_MAY_ALIAS works around GCC warnings about breaking strict aliasing rules when casting storage address to T*
|
||||
union BOOST_MAY_ALIAS dummy_u
|
||||
{
|
||||
char data[ sizeof(T) ];
|
||||
unsigned char data[ sizeof(T) ];
|
||||
BOOST_DEDUCED_TYPENAME type_with_alignment<
|
||||
::boost::alignment_of<T>::value >::type aligner_;
|
||||
} dummy_ ;
|
||||
|
@ -129,7 +129,6 @@ class optional_base : public optional_tag
|
||||
protected :
|
||||
|
||||
typedef T value_type ;
|
||||
typedef typename boost::remove_const<T>::type unqualified_value_type;
|
||||
|
||||
protected:
|
||||
typedef T & reference_type ;
|
||||
@ -406,14 +405,14 @@ class optional_base : public optional_tag
|
||||
|
||||
void construct ( argument_type val )
|
||||
{
|
||||
::new (m_storage.address()) unqualified_value_type(val) ;
|
||||
::new (m_storage.address()) value_type(val) ;
|
||||
m_initialized = true ;
|
||||
}
|
||||
|
||||
#ifndef BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES
|
||||
void construct ( rval_reference_type val )
|
||||
{
|
||||
::new (m_storage.address()) unqualified_value_type( boost::move(val) ) ;
|
||||
::new (m_storage.address()) value_type( boost::move(val) ) ;
|
||||
m_initialized = true ;
|
||||
}
|
||||
#endif
|
||||
@ -425,7 +424,7 @@ class optional_base : public optional_tag
|
||||
template<class... Args>
|
||||
void construct ( in_place_init_t, Args&&... args )
|
||||
{
|
||||
::new (m_storage.address()) unqualified_value_type( boost::forward<Args>(args)... ) ;
|
||||
::new (m_storage.address()) value_type( boost::forward<Args>(args)... ) ;
|
||||
m_initialized = true ;
|
||||
}
|
||||
|
||||
@ -456,13 +455,13 @@ class optional_base : public optional_tag
|
||||
template<class Arg>
|
||||
void construct ( in_place_init_t, Arg&& arg )
|
||||
{
|
||||
::new (m_storage.address()) unqualified_value_type( boost::forward<Arg>(arg) );
|
||||
::new (m_storage.address()) value_type( boost::forward<Arg>(arg) );
|
||||
m_initialized = true ;
|
||||
}
|
||||
|
||||
void construct ( in_place_init_t )
|
||||
{
|
||||
::new (m_storage.address()) unqualified_value_type();
|
||||
::new (m_storage.address()) value_type();
|
||||
m_initialized = true ;
|
||||
}
|
||||
|
||||
@ -516,20 +515,20 @@ class optional_base : public optional_tag
|
||||
template<class Arg>
|
||||
void construct ( in_place_init_t, const Arg& arg )
|
||||
{
|
||||
::new (m_storage.address()) unqualified_value_type( arg );
|
||||
::new (m_storage.address()) value_type( arg );
|
||||
m_initialized = true ;
|
||||
}
|
||||
|
||||
template<class Arg>
|
||||
void construct ( in_place_init_t, Arg& arg )
|
||||
{
|
||||
::new (m_storage.address()) unqualified_value_type( arg );
|
||||
::new (m_storage.address()) value_type( arg );
|
||||
m_initialized = true ;
|
||||
}
|
||||
|
||||
void construct ( in_place_init_t )
|
||||
{
|
||||
::new (m_storage.address()) unqualified_value_type();
|
||||
::new (m_storage.address()) value_type();
|
||||
m_initialized = true ;
|
||||
}
|
||||
|
||||
@ -674,7 +673,7 @@ class optional_base : public optional_tag
|
||||
template<class Expr>
|
||||
void construct ( Expr&& expr, void const* )
|
||||
{
|
||||
new (m_storage.address()) unqualified_value_type(boost::forward<Expr>(expr)) ;
|
||||
new (m_storage.address()) value_type(boost::forward<Expr>(expr)) ;
|
||||
m_initialized = true ;
|
||||
}
|
||||
|
||||
@ -695,7 +694,7 @@ class optional_base : public optional_tag
|
||||
template<class Expr>
|
||||
void construct ( Expr const& expr, void const* )
|
||||
{
|
||||
new (m_storage.address()) unqualified_value_type(expr) ;
|
||||
new (m_storage.address()) value_type(expr) ;
|
||||
m_initialized = true ;
|
||||
}
|
||||
|
||||
@ -733,7 +732,7 @@ class optional_base : public optional_tag
|
||||
{
|
||||
// An exception can be thrown here.
|
||||
// It it happens, THIS will be left uninitialized.
|
||||
new (m_storage.address()) unqualified_value_type(boost::move(expr.get())) ;
|
||||
new (m_storage.address()) value_type(boost::move(expr.get())) ;
|
||||
m_initialized = true ;
|
||||
}
|
||||
}
|
||||
@ -746,7 +745,7 @@ class optional_base : public optional_tag
|
||||
{
|
||||
// An exception can be thrown here.
|
||||
// It it happens, THIS will be left uninitialized.
|
||||
new (m_storage.address()) unqualified_value_type(expr.get()) ;
|
||||
new (m_storage.address()) value_type(expr.get()) ;
|
||||
m_initialized = true ;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user