Const sucks

Janice Caron caron800 at googlemail.com
Mon Sep 10 15:56:53 PDT 2007


On 9/10/07, Alexander Panek <a.panek at brainsware.org> wrote:
> What exactly is the is the difference between head and tail const?

Suppose you have a pointer to pointer to pointer to pointer to pointer to int.
(The length of this chain is irrelevant. I just threw lots in for the
hell of it).

Head const would be
const pointer to pointer to pointer to pointer to pointer to int.

Tail const would be
pointer to const pointer to const pointer to const pointer to const
pointer to const int.

Total const would be
const pointer to const pointer to const pointer to const pointer to
const pointer to const int.

i.e. head const and tail const both at the same time.



More information about the Digitalmars-d mailing list