Re: Newby: VC6 errors

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Tim Roberts wrote:
David Wilkinson <no-reply@xxxxxxxxxxxx> wrote:

You are also missing:

#include <string>

I would also recommend not to use

using namespace std;

in a header file. It defeats the whole purpose of having a
separate namespace for the standard library.

I'm not sure that's true. The "whole purpose" of having a separate
namespace is to let me choose whether I'm willing to pollute my
global namespace.

Sure, as long as you are the sole user of that header file. If it is
also used by others, you have made the choice for them as well. Not
always appreciated!


Bo Persson


.



Relevant Pages

  • Re: location of using, include, and namespaces statement
    ... #ifndef H_TREE ... functions they declare are *not* part of your namespace! ... The first rule is to make the header file idempotent; ... Since the user never sees the .cxx file (that is, ...
    (alt.comp.lang.learn.c-cpp)
  • Re: MC++ DLL (VS.2003) compiler errors...(sigh!)
    ... I have been working on trying to create a DLL written in MC++. ... Interfaces go into header file but that's all I think I have right. ... using namespace System::IO; ... Int32 line; ...
    (microsoft.public.dotnet.languages.vc)
  • Re: Disable OLE DB support in an MCF app
    ... there is a DBID structure conflict ... between oledb.h and the Loutes Notes API header file. ... for name conflict we should consider to use namespace ...
    (microsoft.public.vc.mfc)
  • Re: Disable OLE DB support in an MCF app
    ... there is a DBID structure conflict (redefinition) ... between oledb.h and the Loutes Notes API header file. ... it is possible to disable OLEDB support from stdafx.h. ... for name conflict we should consider to use namespace ...
    (microsoft.public.vc.mfc)
  • Re: Namespace of Interesting/Important Constants ?
    ... No there is no header file or namespace per se. ... Instead the Framework took an OO approach (encapsulation) in that ...
    (microsoft.public.dotnet.languages.vb)