If there is something like below in code:
func(const base& obj)
what does the const semantics mean? What is constant here ? Is obj a const reference to a non-const object
or a non-const reference to a const object
?
There is no such thing as a "non-const" reference, that is, a reference is always bound to the same object and there is no way to change that. "const type&" means reference to const type.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With