• Register

Solution:

To solve this problem you have to employ using with templates

Code:

#include <vector>

template <typename T>
using DataElement = std::vector<T>;

template <typename T>
using DataVector = std::vector<DataElement<T>>;

int main()
{
    DataVector<double> data;
    data.emplace_back(DataElement<double>{ 1.0f, 1.0f });
    data.emplace_back(DataElement<double>{ 1.1f, 1.1f });
}

Hopefully, you are able to solve this problem.

posted Jul 4 in c++ 17,260 points