void construct_value()const { if(!value_cted()){ /* value_ptr must be ==0, oherwise copy_value would have been called */ key_type k(*key_ptr()); key_ptr()->~key_type(); value_ptr= /* guarantees key won't be re-dted at ~rep_type if the */ static_cast<value_type*>(spc_ptr())+1; /* next statement throws */ value_ptr=new(spc_ptr())value_type(k); } }
void construct_value()const { if(!value_cted()){ /* value_ptr must be ==0, oherwise copy_value would have been called */ #if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) key_type k(std::move(*key_ptr())); #else key_type k(*key_ptr()); #endif key_ptr()->~key_type(); value_ptr= /* guarantees key won't be re-dted at ~rep_type if the */ static_cast<value_type*>(spc_ptr())+1; /* next statement throws */ value_ptr=new(spc_ptr())value_type(k); } }
~rep_type() { if(!value_ptr) key_ptr()->~key_type(); else if(value_cted())value_ptr->~value_type(); }
void copy_value()const { if(!value_cted())value_ptr=new(spc_ptr())value_type(*value_ptr); }
void move_value()const { if(!value_cted())value_ptr= new(spc_ptr())value_type(std::move(const_cast<value_type&>(*value_ptr))); }