Код: Выделить всё
#include
struct S
{
S() : m{42} {}
S(int a) : m{a} {}
int m;
};
int main()
{
S s;
// Expression `S{}` is prvalue
// May appear on the right-hand side of an assignment expression
s = S{};
std::cout
Подробнее здесь: [url]https://stackoverflow.com/questions/79151962/assignment-to-a-prvalue-in-c[/url]
Мобильная версия