In my attempt to teach myself C++, I was hoping to get some help in how to read the const-ness of a expression/function etc. For example, the code below:
const screen &display(std::ostream &output) const {
do_display(output); return *this;
}
In the above code. there are two const
declarations in the function display
. In "English" how is that properly read? example: the first const
is a const
to reference or const
to type screen
? etc. and what exactly does the const
-ness mean/imply when a reference is const etc. I have tried reading up on it but is still a bit muddy at this point.
Feel free to point to a youtube video or other reference material. Hopefully the material that is very clear.