used dtor_optimized in destroy for branch free destroy

[SVN r77238]
This commit is contained in:
Christopher Hite
2012-03-05 19:43:14 +00:00
parent 592795e00b
commit a397c16d4c
2 changed files with 14 additions and 8 deletions

View File

@ -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 ;
}

View File

@ -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;
}