Consider the following C++20 code; assume T
to be non-movable and non-copyable:
struct Cell
{
Cell(T&& instance) : obj(std::move(instance)) {}
private:
T obj;
};
Cell cell(T{/* arguments */});
Is move elision guaranteed in the constructor of Cell
?
If T
were movable, would it be guaranteed that only the regular (non-move) constructor would be invoked?