Reputation: 7205
Suppose I have a class:
template <unsigned M, unsigned N, typename T = float>
class Matrix
{};
I want to read from a file which contains matrices of some unknown M,N and create the above type:
Matrix getMatrixFromFile(std::string &path);
Is this possible given that M, N are not known at compile time?
Upvotes: 0
Views: 137
Reputation: 7773
The answer is no.
The templates parameters are used to create types at compile time based on the types passed.
Upvotes: 3