Advertisement
Guest User

Untitled

a guest
Mar 27th, 2017
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. template<typename T>
  2. void f(const T& param); // param is now a ref-to-const; paramType is const T&
  3.  
  4. int x = 27; // as before
  5. const int cx = x; // as before
  6. const int& rx = x; // as before
  7.  
  8. f(x); // T is int, param's type is const int&
  9. f(cx); // T is int, param's type is const int&
  10. f(rx); // T is int, param's type is const int&
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement