Should it be in a namespace?
Posted
by Knowing me knowing you
on Stack Overflow
See other posts from Stack Overflow
or by Knowing me knowing you
Published on 2010-04-11T13:29:55Z
Indexed on
2010/04/11
13:43 UTC
Read the original article
Hit count: 127
c++
|namespaces
Do I have to put code from .cpp in a namespace from corresponding .h or it's enough to just write using declaration?
//file .h
namespace a
{
/*interface*/
class my
{
};
}
//file .cpp
using a::my; // Can I just write in this file this declaration and
// after that start to write implementation, or
// should I write:
namespace a //everything in a namespace now
{
//Implementation goes here
}
Thanks.
© Stack Overflow or respective owner