Why can't I declare a templated type alias inside of a function?
#include <vector>
int main(){
//type alias deceleration:
template <typename T>
using type = std::vector<T>;
//type instantiation:
type<int> t;
}
error: a template declaration cannot appear at block scope
Why are we forced to put these declarations outside of block scope?
#include <vector>
//type alias deceleration:
template <typename T>
using type = std::vector<T>;
int main(){
//type instantiation:
type<int> t;
}