octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: C++ namespace?


From: Shai Ayal
Subject: Re: C++ namespace?
Date: Wed, 20 Feb 2008 06:23:14 +0200

On Feb 19, 2008 11:35 PM, John W. Eaton <address@hidden> wrote:
>
>
>
> On 12-Feb-2008, Shai Ayal wrote:
>
> | On Feb 12, 2008 12:23 PM, John W. Eaton <address@hidden> wrote:
> | > A message was sent recently to the help list requesting that we put
> | > the Octave classes/functions in a namespace.  Since the poster was not
> | > subscribed to the list, the message was not posted automatically.
> | > Also, since it was not really a request for help using Octave, I asked
> | > that he repost his message here, but I haven't seen it.  In any case,
> | > the suggestion has merit, so what do people think about introducing an
> | > "octave" namespace around all the C++ functions in the Octave
> | > libraries?
> |
> | What are the implications for octave sources -- just add a using
> | octave line to all .h files?
>
> I think it might not be desirable to put a "using namespace octave"
> directive in all the .h files.  Shouldn't it be up to the users of the
> .h files to decide which symbols to import from a given namespace?  If
> each of the Octave header files include a "using namespace octave"
> line, aren't we forcing the symbols on the users of the .h files in
> the same way as we do now without the namespace?  Or is there some way
> for a user of the .h file to undo the using directive?
>
> Although we tag functions from the C++ standard library with  "std::",
> I was definitely not planning to tag all Octave functions with
> "octave::", so I would expect that we would add "using namespace
> octave" directives to the Octave .cc files.
>

yes I think that adding "using namespace octave" to the cc files is a
better idea

Shai


reply via email to

[Prev in Thread] Current Thread [Next in Thread]