I have a function like so
template <typename T>
double vectortest(int n, bool prealloc) {
std::vector<T> tester;
std::unordered_set<T> seq = generatenums<T>(n);
}
Where generatenums is another templatized function
template <typename T>
std::unordered_set<T> generatenums(int n) {
std::unordered_set<T> ret;
}
Please note: I have truncated the entire contents of these functions, leaving only what I think is relevant to my question.
I also have a struct
typedef struct Filler
{
int value;
int padding[2500];
};
And I want to be able to invoke my functions like so
vectortest<Filler>(5, true);
But this generates a lot of errors, and leaves me wondering why I can't use struct as a type for C++ templates, and if there's a way around this?