Function Template Overload Resolution & Compiler Optimizations
问题 I was looking at this question found here Template function overload for type containing a type Where the OP user2079802 provided this code for his/her question: I'm trying to do the following: #include <iostream> #include <vector> #include <tuple> template <typename T> void f(T t) { std::cout << "1" << std::endl; } template <typename T, typename V> void f(T<std::tuple<V>> t) { std::cout << "2" << std::endl; } int main() { f(std::list<double>{}); // should use first template f(std::vector<std