Код: Выделить всё
#include
#include
int main()
{
std::vector v(10, 7); // OK
std::array a(7); // does not compile, pretty frustrating
}
Сейчас я использую это:
Код: Выделить всё
std::array a;
for (auto & v : a)
v = 7;
Подробнее здесь: https://stackoverflow.com/questions/577 ... same-value
Мобильная версия