Код: Выделить всё
class Foo {
public:
...
static const std::vector _data;
< /code>
В соответствующем исходном файле я заполняю данные ... < /p>
const std::vector
Foo::_data
{
std::make_tuple("One", 1),
std::make_tuple("Two", 2),
...
std::make_tuple("Many", 10)
};
Код: Выделить всё
/path/to/src/Data.cpp:783:14: warning: initialization of '_data' with static storage duration may throw an exception that cannot be caught [cert-err58-cpp]
Foo::_data
^
/path/to/gcc-9.2.0/lib/gcc/x86_64-redhat-linux/9.2.0/../../../../include/c++/9.2.0/bits/stl_vector.h:622:7: note: possibly throwing constructor declared here
vector(initializer_list __l,
^
Использование std :: array вместо std :: vector просто подталкивает проблему до ate_tuple ...
Подробнее здесь: https://stackoverflow.com/questions/794 ... -container