Re: MVC in C++

From: Bjorn Reese (breese_at_see.signature)
Date: 02/27/05


Date: Sun, 27 Feb 2005 14:05:32 +0100

Phlip wrote:

> Sutter and Alexandrescu say 'using namespace X' is "not evil", but they
> don't go as far as supplying 'std' for X.

They are discussing "using namespace" in general, and provide no
exception or special treatment for std.

Let me quote the relevant passage:

  "In all headers, and in all implementation files before the last
   #include, always explicitly namespace-qualify all names. In
   implementation files after all #includes, you can and should
   write namespace using declarations and directives liberally.
   This is the right way to reconcile code brevity with modularity."

> Leave that up to your team to decide.

Please make up your mind. First "nobody should use 'using namespace
std'", and now the team can decide. I can agree with the latter, but
not the former.

-- 
mail1dotstofanetdotdk


Relevant Pages

  • Re: friend operator << overload ambiguity error
    ... > standard. ... > users to add names to namespace std under the right circumstances. ... A program may add template specializations for any standard library template ...
    (comp.lang.cpp)
  • Re: forward declarations and namespaces?
    ... I didn't even want to introduce the namespace at that point. ... non-conforming by introducing my own names into std:: This is the whole ... templateclass valarray; ... forwar declaration in there. ...
    (comp.lang.cpp)
  • Re: everywhere, i need to use std::
    ... >> It's normally safe to include namespace std in a module, ... >> don't also globally include another namespace as well. ... An extern library/framework providing ... stdcli:: as needed, to make it obvious which one is being used. ...
    (comp.lang.cpp)
  • Re: Is there a convention mandating macros to be all-uppper-case?
    ... the std namespace, unless you are a standard library vendor (even they ... from adding your own declarations to the std ...
    (microsoft.public.vc.language)
  • Hello world!
    ... Installed Cbuilder from Borland, and try to build the helloworld program ... "main.cpp": HelloWorld/main.cpp error: `cout' undeclared in namespace ... `std' at line 6 ...
    (comp.lang.cpp)