What to do if I hate C++ header files?
        Posted  
        
            by 
                BlaXpirit
            
        on Programmers
        
        See other posts from Programmers
        
            or by BlaXpirit
        
        
        
        Published on 2011-01-10T15:57:38Z
        Indexed on 
            2011/01/10
            16:58 UTC
        
        
        Read the original article
        Hit count: 243
        
I was always confused about header files. They are so strange: you include .h file which doesn't include .cpp but .cpp are somehow compiled too.
NOTE: I UNDERSTAND EVERYTHING ABOUT THE HEADERS, PLEASE DON'T TELL ME I'M STUPID OR SHOULD USE OTHER LANGUAGE  
Recently I joined a team project, and of course, both .h and .cpp are used.
I understand that this is very important, but I can't live with copy-pasting every function declaration in each of multiple classes we have.
How do I handle the 2-file convention efficiently?
Are there any tools to help with that, or automatically change one file that looks like example below to .h and .cpp? (specifically for MS VC++ 2010)
class A
{
...
    Type f(Type a,Type b)
    {
        //implementation here, not in another file!
    }
...
};
Type f(Type a)
{
     //implementation here
}
...
© Programmers or respective owner