I’m using a C++ compiler with the C++0x specification, and want to make my move constructor for a String class that wraps around a std::wstring.
class String {
public:
String(String&& str) : mData(std::move(str.mData)) {
}
private:
std::wstring mData;
};
In Visual Studio, this works flawlessly. In Xcode, std::move() is not available.
std::movesimply casts its argument to an rvalue reference. You could write your own version: