Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- template<typename T>
- void f(const T& param); // param is now a ref-to-const; paramType is const T&
- int x = 27; // as before
- const int cx = x; // as before
- const int& rx = x; // as before
- f(x); // T is int, param's type is const int&
- f(cx); // T is int, param's type is const int&
- f(rx); // T is int, param's type is const int&
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement