|
Boost : |
From: Ehsan Akhgari (ehsan_at_[hidden])
Date: 2003-10-12 11:10:27
[snip]
> I'm wondering if this rule also applies to qualifiers. If I want two
> pointers to constant objects, can I do:
>
> int const *a, *b; //[3]
>
> or do I have to do:
>
> int const *a, const *b; //[4]
>
> (which means that [3] gives one const and one non-const pointer)?
The correct form is [3].
> This is an one-time thing, so I don't want to waste time with a
> typedef or two separate object declaration lines if I don't have to.
You could have easily figured this out by trying to compile the
following:
int main()
{
int const * p1, * p2;
*p1 = 0;
*p2 = 0;
}
-------------
Ehsan Akhgari
List Owner: MSVC_at_[hidden]
[ Email: ehsan_at_[hidden] ]
[ WWW: http://www.beginthread.com/Ehsan ]
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk