Boost logo

Boost :

From: Daryle Walker (darylew_at_[hidden])
Date: 2003-10-12 00:37:32


This for something I'm thinking of adding to the sandbox....

I know that

    int * a, b; //[1]

makes one pointer object and one integer object. (The asterisk binds to the
object, not the type.) If I want two pointers, I need

    int *a, *b; //[2]

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)?

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.

Daryle


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