Topic: Definition namespaces (was: template block proposal to simplify out


Author: musiphil@bawi.org (KIM Seungbeom)
Date: Wed, 29 Jan 2003 14:05:11 +0000 (UTC)
Raw View
"David B. Held" wrote:
>
> I actually like the idea of using namespace to create what amounts
> to a type of "with clause".  It's like James Kanze's suggestion, only
> without introducing a new keyword.  And logically, 'namespace'
> seems most appropriate in this context anyway.  However, I would
> rearrange the syntax, so it appears like this:
>
> namespace class Foo { /* ... */ }
>
> namespace template <typename T> class Goo { /* ... */ }

I'm not sure if it would be really good to use the keyword 'namespace'
here. A class constitutes a 'name space' (in the general meaning), but
a class is not a 'namespace' (in the C++ specific meaning). Wouldn't
it be confusing to use the same word for two different things?

--
KIM Seungbeom <musiphil@bawi.org>

---
[ 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://www.jamesd.demon.co.uk/csc/faq.html                       ]





Author: musiphil@bawi.org (KIM Seungbeom)
Date: Thu, 30 Jan 2003 16:20:01 +0000 (UTC)
Raw View
"David B. Held" wrote:
>
> "KIM Seungbeom" <musiphil@bawi.org> wrote in message
> news:3E372833.91C3F193@bawi.org...
> > [...]
> > I'm not sure if it would be really good to use the keyword 'namespace'
> > here. A class constitutes a 'name space' (in the general meaning), but
> > a class is not a 'namespace' (in the C++ specific meaning). Wouldn't
> > it be confusing to use the same word for two different things?
>
> You mean like 'static'?  Or 'virtual'?  Or 'class'?  I personally don't think
> it would be confusing because the name of the namespace is special.
> And I can't think of another keyword that is as appropriate.  Nor do I
> think it appropriate to introduce another keyword for this particular
> feature.

Do we really have to use a keyword for this?
Magnus Lidbom suggested suggested a syntax that use one:

    class Foo::
    {
        int f() const
        {
             //...
        }
    };

--
KIM Seungbeom <musiphil@bawi.org>

---
[ 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://www.jamesd.demon.co.uk/csc/faq.html                       ]