-1
これは以前の質問Explicit move constructor needed in container?の変更です。コンパイラ定義の移動コンストラクタを持たないコンテナ内に明示的な移動コンストラクタが必要ですか?
私は、テンプレートコンテナクラスを持っている:
template<class Stuff>
class Bag{
public:
~Bag() {//Do some stuff here so that the compiler doesn't implement move semantics}
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は移動またはコピーされますか?
グリッド内のすべての行について質問しますか? –
「バッグ」が動かない場合、なぜ動くのでしょうか? – NathanOliver
[似たような質問](https://stackoverflow.com/q/44573222/7359094)あなたは2時間前に尋ねました。 –