If I want to alias a template class for a known type in c++, I do something like this :
using MyVector = std::vector<MyClass>;
How do I ahieve the same for function templates?
template <typename T> void MyFunction(T MyValue);
I tried :
using MyIntFunction = MyFunction<int>;
But its not working.
Alias declarations are meant to introduce aliases for types.
Anyway, you can use a
constexpr
variable to do what (I suspect) you are trying to do:It follows a minimal, working example:
You can not use template aliases for functions, there is no such syntax.