Why can't I declare a template alias inside a function?
#include <vector>
int main(){
template <typename T>
using type = std::vector<T>;
type<int> t;
}
error: template declaration cannot be displayed in the scope area
Why are we forced to place these ads outside the block area?
#include <vector>
template <typename T>
using type = std::vector<T>;
int main(){
type<int> t;
}
source
share