Saturday, 15 January 2011

c++ - Splitted namespace in header file -



c++ - Splitted namespace in header file -

i'm working on existing c++ project.

during code analysis found header files, containing namespace definition split in 2 parts(see c1.h). first part containing forward-declarations , sec part containing class declaration.

c1.h

namespace { namespace b { class c2; class c3; }} namespace { namespace b { class c1 { public: //... private: //... }; }}

c1_foo.h

namespace { namespace b { class c2; class c3; class c1_foo { public: //... private: //... }; }}

my question:

is there reason splitting 2 logical parts? c1_foo.h declare different? i've never seen before...

thx help!

no, there no functional difference @ all.

apparently programmer likes maintain forwards declarations exclusively separate, kind of makes stylistic sense think it.

c++ namespaces

No comments:

Post a Comment