Boost logo

Boost :

From: Dave (dave_at_[hidden])
Date: 2001-07-26 18:33:29


John Max Skaller wrote:
>
> T const * const * const * const x = ..
>
> is consistent.
>
> const T * const * const * const x = ..
>
> plainly isn't.

Both are consistent with the Standard. In both lines above, the
"const" qualifier and the type name "T" are parts of the
declaration specifier. The parts of a decl-specifer can appear
in any order. The longest sequence is taken for the complete
declaration specifier. (C++ 7.1/2). Either way reads perfectly
clearly to me.

> const int *
>
>is obviously very bad practice...

In what way? "const int" is a valid declaration specifier. The
asterisk is part of the declarator (8.3.1). It reads perfectly
well to me -- and to the compiler.

    -- Dave Miller


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk