Ambiguity error in C++17 (template template parameters and default arguments issue)
问题 I have code which is differently interpreted by g++ with the c++14 and c++17 standard flags: #include <iostream> #include <vector> template<class T, class A> void func(const std::vector<T, A>&v) { std::cout << 1 << std::endl; } template<typename T, template <typename>class Vector> void func(const Vector<T>&v) { std::cout << 2 << std::endl; } void f() { std::vector<int> v; func(v); } int main() { f(); return 0; } When I'm trying compile this code with command g++ -std=c++14 -Wall -pedantic