mirror of
https://github.com/boostorg/optional.git
synced 2025-07-29 20:17:21 +02:00
used dtor_optimized in destroy for branch free destroy
[SVN r77238]
This commit is contained in:
@ -453,7 +453,9 @@ class optional_base : public optional_tag
|
||||
|
||||
void destroy()
|
||||
{
|
||||
if ( m_initialized ){
|
||||
if( dtor_optimized::value )
|
||||
m_initialized = false ;
|
||||
else if ( m_initialized ){
|
||||
destroy_impl(is_reference_predicate()) ;
|
||||
m_initialized = false ;
|
||||
}
|
||||
|
@ -36,14 +36,18 @@ BOOST_STATIC_ASSERT( of::copy_optimized::value );
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
has_trivial_assign
|
||||
has_trivial_constructor
|
||||
has_trivial_copy
|
||||
has_trivial_copy_constructor
|
||||
has_trivial_default_constructor
|
||||
has_trivial_destructor
|
||||
* The code generated below can be looked at with objdump to see if it is suboptimal
|
||||
*/
|
||||
|
||||
|
||||
void assign_optional_int(oi& x,oi& y){
|
||||
x=y;
|
||||
}
|
||||
|
||||
void reset_optional_int(oi& x){
|
||||
x=boost::none;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user