Topic: Namespace members added with using-declaration


Author: "Vlad Harchev" <vladhar@imimail.ssau.ru>
Date: 1998/09/04
Raw View
CD2  says, that using-declaration adds a member(s) to the namespace
containing this using-declaration. If the type name 'nm' has been added to
namespace X (firstly) and then the object with such name 'nm' is declared in
namespace X, will the name of the object hide the name of the type? CD2
doesn't contain answer ( it specifies the behaviour if the same declarations
have been performed in the reverse order - it's illega in that case).

Example:

namespace A { struct nm {}; }
namespace X


     using A::nm;
     int nm; // will it hide struct A::nm here or this is illegal ?
  };




[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html              ]