Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- template <class T1, class T2>
- void function(T1 a, T1 b, T2 c) { ... }
- template <class T1, class T2>
- void function(T1 a, T1 b, T2 c = С) { ... }
- template<typename T, typename U = int>
- void f(T a, T b, U c = U(0))
- {
- cout << a << " " << b << endl;
- cout << typeid(c).name() << endl;
- cout << c << endl;
- }
- int main()
- {
- f(0,1,3);
- f(0,1,3.0);
- f(0,1);
- }
- template <class T1, class T2>
- void function(T1 a, T1 b, T2 c)
- {
- ...
- }
- template <class T1>
- void function(T1 a, T1 b)
- {
- function(a, b, C);
- }
Add Comment
Please, Sign In to add comment