私は、テンプレートコンテナクラスを持っている:明示的な移動コンストラクタがコンテナに必要ですか?
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