   How to organize this code...
  I have a large amount of code that is getting unwieldy. It is of the following format:// bigheader.hvoid GROUP1foo1();void GROUP1foo2();void GROUP1foo3();void GROUP1foo4();void GROUP1foo5();void GROUP1foo6();...void GROUP2foo1();void GROUP2foo2();void GROUP2foo3();void GROUP2foo4();void GROUP2foo5();void GROUP2foo6();...#include "GROUP1imp.inl"#include "GROUP2imp.inl"#include "GROUP3imp.inl"...The "imp.inl" files are fairly small, but the "bigheader.h" is getting cumbersome. I would like to move the func declarations into separate headers, but I still need all the .inl's to see all the declarations.I tried replacing the above with:// bigheader.h#include "GROUP1decls.h"#include "GROUP2decls.h"#include "GROUP3decls.h"...#include "GROUP1imp.inl"#include "GROUP2imp.inl"#include "GROUP3imp.inl"...But this caused problems. What idiom do you propose?   
  I propose the idiom whereby you tell me what "caused problems" really means, as on the surface that is perfectly acceptable.What exactly are all these methods doing? If their implementation is gated on the numbers (group and foo) then you might be able to use non-type template parameters and reduce all of that crap into a single function.   ;Quote:Original post by jpetrieI propose the idiom whereby you tell me what "caused problems" really means, as on the surface that is perfectly acceptable.Well, I guess the 1st thing I wanted to know, is, on the surface, is it perfectly acceptable? Can you really have the declarations in a separate header than the (inline) implementations? It could be just the .h extension that gave me problems before (VS2005).Anyhow, I will try again and tell you the exact problem that arose.Quote:Original post by jpetrieWhat exactly are all these methods doing? If their implementation is gated on the numbers (group and foo) then you might be able to use non-type template parameters and reduce all of that crap into a single function.I'd like to ignore that issue for now... just a pet example. But yeah, I hear you on the non-type template solution (it doesn't apply here).   ;  Unless the header files accidentally have the same include guards, then it looks like it should work.  However, if you are looking for better ways to organize your headers/code, there is an excellent overview here.Otherwise, we need more detail as to what you're trying to do.--random   ;Quote:Can you really have the declarations in a separate header than the (inline) implementations? It could be just the .h extension that gave me problems before (VS2005).No it didn't, you wrote bad code. The preprocessor just does naive textual subsitution on files that are #include'd into source files -- nothing else. The extension is even completely irrelevant.If a file contains:ABthan it is the same as a file containing#include "A.h"Bby the time the compiler sees it.If "the .h file gave you problems" before, it was because either you had configured the compiler incorrectly (so it didn't know how to search for files that were specified in preprocessor include directories), or you wrote code that was illegal (just as illegal as if it had been written in a single file). Although admittedly, as I discuss here, the operation of the preprocessor substition can make code that looks kosher fail to compile -- so in effect, you can think you wrote good code, but what you really wrote was bad code.That said, simply filing away the code behind an #include file should have no effect, as long as you don't change anything and as long as your environment is properly configured.Let me know when you find the specific error.   ;  The transition worked out. I had cleaned up my code since then, so this time there were no problems.Thanks for the advice and the article.   