Код: Выделить всё
SubTable). Затем это значение преобразуется в std::moveLiveDemo
Код: Выделить всё
#include
struct SubTable {
SubTable() = default;
SubTable(SubTable&& other) {
std::cout SubTable
{
return subtable;
}
struct Table {
SubTable _subtable;
auto get_subtable() const -> const SubTable&;
};
auto Table::get_subtable() const -> const SubTable& {
return _subtable;
}
int main()
{
Table hello;
auto subtable = SubTable::from_subtable(std::move(hello.get_subtable()));
}
Код: Выделить всё
Moved subtable
Подробнее здесь: https://stackoverflow.com/questions/792 ... ove-constr
Мобильная версия