Recently I started naming my modules like this:
1. Class Module:
Foo\Foo.class.h:
Foo\Foo.class.cpp:Code:#ifndef FOO_FOO_CLASS_H #define FOO_FOO_CLASS_H namespace foo { class Foo {...}; } #endif// FOO_FOO_CLASS_H
Code://Foo\Foo.class.cpp #include "Foo.class.h" using namespace foo; Foo::Foo() {...}
2. A header with namespace declarations:
foo.ns.h:
Code://Foo.ns.h #ifndef FOO_NS_H #define FOO_NS_H namespace foo { ...}; #endif//FOO_NS_H
3. A library include file:
Foolib.lib.h:
Code://Foolib.lib.h #ifndef FOO_LIB_H #define FOO_LIB_H #include "Foo.ns.h" //Foolib namespace declaration #include "Foo\Foo.class.h" //... #include "Foo\Other.class.h" #endif//FOO_LIB_H
I searched Google or any C++ standart violations and found none...
It is kind of usefull to me, because by just looking at the file structure I could understand what is the purpose of each file .
What do you think about it ?
Any suggestions ?
Vote!
(usefull or not)