C ++ 11 GCC 4.6.2 std :: move [英] C++11 GCC 4.6.2 std::move
本文介绍了C ++ 11 GCC 4.6.2 std :: move的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我试图使用移动构造函数,使用std :: move
I tried to use move constructor, with std::move
#include <utility>
但是我收到一个错误,'move'不是'std'的成员。
But I receive an error, ‘move’ is not a member of ‘std’.
gcc --version
gcc (GCC) 4.6.2 20111027 (Red Hat 4.6.2-1)
我理解move constructor是C ++ 11中的一个新功能,只是想知道它是否在gcc 4.6.2。
I understand move constructor is a new feature in C++11, just wondering whether it is available in gcc 4.6.2 yet.
感谢。
推荐答案
0x标志( -std = c ++ 0x
)? g ++默认为C ++ 03。
Did you compile with the C++0x flag on (-std=c++0x
)? g++ defaults to C++03.
这篇关于C ++ 11 GCC 4.6.2 std :: move的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文