Solution
Here is the solution to the problem in the previous lesson.
We'll cover the following
Explanation
The following changes were applied:
- We turned
StringVectorHolder::print
into aconst
function - We gave
StringVectorHolder::operator[]
aconst
overload- It still invoked a compiler error as the return type was a non-
const&
that discarded theconst
qualifier, so we turned the return type into aconst&
.
- It still invoked a compiler error as the return type was a non-
Get hands-on with 1400+ tech skills courses.