Beispiel #1
0
    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);
      }
    }
Beispiel #2
0
    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);
      }
    }
Beispiel #3
0
 ~rep_type()
 {
   if(!value_ptr)       key_ptr()->~key_type();
   else if(value_cted())value_ptr->~value_type();
 }
Beispiel #4
0
 void copy_value()const
 {
   if(!value_cted())value_ptr=new(spc_ptr())value_type(*value_ptr);
 }
Beispiel #5
0
 void move_value()const
 {
   if(!value_cted())value_ptr=
     new(spc_ptr())value_type(std::move(const_cast<value_type&>(*value_ptr)));
 }