Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- template <typename T>
- inline T const& max (T const& a, T const& b)
- {
- std::cout << "template" << 'n';
- return a < b ? b : a;
- }
- template <typename T>
- inline T const& max (T const& a, T const& b, T const& c)
- {
- return max (max(a,b), c);
- }
- inline int const& max (int const& a, int const& b)
- {
- std::cout << "non-template" << 'n';
- return a <b ? b : a;
- }
- int main()
- {
- std::cout << max(3, 5, 7) << 'n';
- }
- template
- template
- 7
- int const& max (int const& a, int const& b);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement