Does gcc STL support rvalue references?

I know that the Visual Studio 2010 Standard Library has been rewritten to support rvalue references, which greatly improves its performance.

Does the standard library support gcc 4.4 (and up) rvalue references?

+2


a source to share


2 answers


I found this from STL gcc 4.4:



#ifdef __GXX_EXPERIMENTAL_CXX0X__
  _Vector_base(_Vector_base&& __x)
  : _M_impl(__x._M_get_Tp_allocator())
  {
    this->_M_impl._M_start = __x._M_impl._M_start;
    this->_M_impl._M_finish = __x._M_impl._M_finish;
    this->_M_impl._M_end_of_storage = __x._M_impl._M_end_of_storage;
    __x._M_impl._M_start = 0;
    __x._M_impl._M_finish = 0;
    __x._M_impl._M_end_of_storage = 0;
  }
#endif

      

+4


a source


GCC supports rvalue references . Unfortunately the libstC ++ page does n't say if the library implementation is using.



+1


a source







All Articles