Boost logo

Boost :

From: Gennaro Prota (gennaro_prota_at_[hidden])
Date: 2002-08-18 10:02:59


On 18 Aug 2002 15:06:29 +0200, Gabriel Dos Reis
<gdr_at_[hidden]> wrote:

>| > His compiler was right; somewhere, the standard says
>| >
>| > 3.3/4
>| > Given a set of declarations in a single declarative region, each of
>| > which specifies the same unqualified name,
>|
>| Note: "unqualified name"
>
>Yes, with the key phrase "in a single declarative region".

I don't know what the original question was, but Bo's reply makes me
think that he has misinterpreted that paragraph (of course, it's
likely that *I* did misinterpret it): it doesn't say that it applies
only when the declaration specifies an unqualified name. It applies
always but you have to see if the unqualified-ids are the same and not
the full qualified name. In practice (unless there's some special case
that I'm missing right now) you never declare a qualified name, just a
name. Example:

namespace N {
 class name;
}

namespace X {
 using N::name;
 typedef N::name name;
}

namespace N {
 class name {};
 using X::name;
}

All the declarations in namespace N ('class name;', 'class name {};'
and 'using X::name;') declare the same name (have the same
unqualified-id) and thus 3.3/4 applies, even if the name in the third
declaration is qualified. Analogously for the declarations in
namespace X.

Am I wrong?

Genny.


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