Rolf Magnus wrote:
> Old Wolf wrote:
>
>> wrote:
>>>
>>> Fundamentally, rvalues and/or temporaries can be bound only to constant
>>> references going by the const guidelines.
>>>
>>> Taking that into consideration, how does one get a constant reference
>>> to a pointer.
>>>
>>> 3> A* foo(A* const & ptr) { } // reference to a constant pointer to A
>>
>> Actually this is a const reference to a pointer to A.
>
> There is no such thing as a "const reference".
A 'const reference' is a reference where the thing it's
referring to, can't be modified via the reference.
(I don't know if this term is in the Standard, but it seems
fairly common practice for describing a type such as T const & )
> The above is a reference to "A* const"
In this case:
A *p;
A * const &q = p;
q refers to p, and p is an A * (not an A * const).
However, p looks like an A * const when viewed through q.
The OP did ask, "how does one get a constant reference
to a pointer". (to which the answer is, his #3).