-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是否会被移动或复制?
您打算询问关于该网格中每一行的问题吗? –
如果'Bag'不能移动,为什么会发生移动? – NathanOliver
[问题2](https://stackoverflow.com/q/44573222/7359094)你问了2个小时前。 –