It's probably confusing because it's mixing two styles of const
together.
const int*const Method3(const int*const&)const;
I will reorder them because the best way to understand these is to read them backwards, in my opinion.
Let's start with the return type:
const int*const -> int const* const
By reading it backwards we get: const
pointer to const int
.
Similarly, for the function parameter:
const int* const& -> int const* const&
By reading it backwards we get: reference to const
pointer to const int
.
The function is also marked as const
, which means it is a member function that can be called when a reference to that class is constant, for example.
For possible const
optimizations and further understanding, see these answers: