mardi 4 juin 2019

Using `std::array` size in another `std::array`

I have an std::array defined in one part of the code

std::array<int, 303> data;

I would like to declare another std::array with the same size. Like this:

std::array<double, data.size()> other_data;

Basically, I would like to use the information from data as opposed to using the same constant. But it fails to compile with -std=c++11. Is it even possible and if yes, what is the best way to do this?

Aucun commentaire:

Enregistrer un commentaire