Код: Выделить всё
#include
#include
struct Sheet {
const int c[2]{};
const int sum = std::accumulate(std::begin(c), std::end(c), 0);
};
int main() {
Sheet sheet0;
Sheet sheet1{{10}};
Sheet sheet2{{10, 20}};
std::cout
Подробнее здесь: [url]https://stackoverflow.com/questions/79161402/inline-member-initialization-with-values-of-other-aggregate-initialized-members[/url]
Мобильная версия