Solution
Here is the solution to the problem in the previous lesson.
We'll cover the following
Explanation
Add this line to class S
:
void foo(const T&& t) = delete;
foo(T&& t)
only prohibits non-const
rvalues. It allows const
rvalues. By deleting the implementation of foo(const T&& t)
, we make sure that no rvalues are accepted.
Get hands-on with 1400+ tech skills courses.