Topic: In the new standard, can nested namespaces be declared?
Author: sbnaran@localhost.localdomain (Siemel Naran)
Date: 1998/09/17 Raw View
On 14 Sep 1998 22:13:45 GMT, Eric Anderson <eric@semaphore.com> wrote:
[snip]
Yes, it works.
--
----------------------------------
Siemel B. Naran (sbnaran@uiuc.edu)
----------------------------------
[ moderator's note: Many other replies that just said "yes" have
not been approved for posting due to being redundant. -sdc ]
[ 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 ]
Author: ncm@nospam.cantrip.org (Nathan Myers)
Date: 1998/09/17 Raw View
Martin von Loewis <loewis@informatik.hu-berlin.de> wrote:
>
>"Eric Anderson" <eric@semaphore.com> writes:
>
>> Can [nested namespaces] happen?
>
>Yes.
More to the point, they're useful. Function names declared in
nested namespaces hide the same names in outer namespaces, rather
than overloading with them (same as in derived classes). This
allows real fine-tuning of what names are visible as long as
users don't mess things up with global using-directives.
--
Nathan Myers
ncm@nospam.cantrip.org http://www.cantrip.org/
[ moderator's note: Many replies that just said "yes" have
not been approved for posting due to being redundant. -sdc ]
[ 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 ]
Author: "Eric Anderson" <eric@semaphore.com>
Date: 1998/09/14 Raw View
f.ex:
// in header file "foo.h"
namespace foo {
namespace bar {
void func();
}
}
// in some cpp file:
#include "foo.h"
void DoSomething()
{
foo::bar::func();
}
Can this happen?
Eric.
[ 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 ]
Author: Martin von Loewis <loewis@informatik.hu-berlin.de>
Date: 1998/09/15 Raw View
"Eric Anderson" <eric@semaphore.com> writes:
> Can this happen?
Yes.
Martin
[ 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 ]
Author: Alexandre Oliva <oliva@dcc.unicamp.br>
Date: 1998/09/15 Raw View
Eric Anderson <eric@semaphore.com> writes:
> In the new standard, can nested namespaces be declared?
Certainly
> namespace foo { namespace bar { void func(); } }
> void DoSomething() { foo::bar::func(); }
> Can this happen?
Yes
[ sorry for the high quote/content rate; this note is an attempt to
reduce it :-) ]
--
Alexandre Oliva
mailto:oliva@dcc.unicamp.br mailto:aoliva@acm.org
http://www.dcc.unicamp.br/~oliva
Universidade Estadual de Campinas, SP, Brasil
[ 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 ]