Код: Выделить всё
#include
#include
struct A {
A() {}
A(const A&) = delete;
A(auto &&) {}
A & operator=(const A&) = delete;
};
static_assert(!std::copy_constructible);
const std::vector v(3);
auto w( v ); // fails only in libstdc++
Код: Выделить всё
/opt/compiler-explorer/gcc-14.2.0/include/c++/14.2.0/bits/stl_uninitialized.h:90:56: error: static assertion failed: result type must be constructible from input type
90 | static_assert(is_constructible::value,
| ^~~~~
Какая реализация здесь правильная?
Подробнее здесь: https://stackoverflow.com/questions/795 ... -assignabl
Мобильная версия