Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- template<typename T> struct A {};
- template<typename T, typename U, typename V> void f(T&, const U&, V) { std::cout << "f1\n"; } //#1
- template<typename T, typename U, typename V> void f(T&&, U&, A<V>) { std::cout << "f2\n"; } //#2
- int main()
- {
- int a = 7;
- const char b = 'a';
- A<int> c;
- f(a, b, c); //Should print 'f2'.
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement