开发者

Does gcc's STL support rvalue references now?

I know Visual Studio 2010's standard library has been rewritten to support rvalue references, which boosts its performance considerably.

Does the standard library implementation of gcc 4.4 (and ab开发者_Python百科ove) support rvalue references?


I found this from the STL of 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


GCC supports rvalue references. Unfortunately, the libstc++ page doesn't say if the library implementation takes advantage of that.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜