- C++14/C++1z 20
736 :デフォルトの名無しさん[sage]:2015/11/21(土) 00:07:18.37 ID:uQbElO9Z - >>733
Concepts の提案に含まれてる。 http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4553.pdf > template<typename T> class Vec { }; > template<typename T, typename U> class Pair { }; > template<typename... Args> class Tuple { }; > > void f1(const auto&, auto); > void f2(Vec<auto*>...); > void f3(Tuple<auto...>); > void f4(auto (auto::*)(auto)); > > template<typename T, typename U> void f1(const T&, U); // redeclaration of f1 > template<typename... T> void f2(Vec<T*>...); // redeclaration of f2 > template<typename... Ts> void f3(Tuple<Ts...>); // redeclaration of f3 > template<typename T, typename U, typename V> void f4(T (U::*)(V)); // redeclaration of f4 auto のほかに制約を定義したコンセプト名も型名のかわりに使える。
|
|