我有一個模板容器類:在容器中顯式移動構造函數?
template<class Stuff>
class Bag{
private:
std::vector<Stuff> mData;
};
我想做
void InPlace(Bag<Array>& Left){
Bag<Array> temp;
Transform(Left, temp); //fills temp with desirable output
Left = std::move(temp);
}
假設數組有用戶定義的移動語義,但袋沒有。在這種情況下mData是否會被移動或複製?
好抓,固定 – AGML