how come #include "*.cpp" works?

Dave Korn dave.korn@artimi.com
Thu May 18 18:31:00 GMT 2006


On 18 May 2006 19:28, mwoehlke wrote:


>>   Something like this?
> (moved below)
> 
> Hey, that's pretty slick... thanks!

  :)  It's a fairly standard technique.  The particularly good thing about it
is that there's no danger of anything getting out-of-sync because it all comes
from one source and hence has to remain consistent.  Gcc and other big
highly-configurable projects do this all the time, and even more advanced
stuff.

> Upon further thought, I may actually do something with my Makefile and
> auto-generation of some file, but I think I'm still going to use part of
> this. (Having an entire class declaration inside of a macro kind-of rubs
> me wrong ;-). Also, I want to keep each class in its own header.)

  Yep, it's certainly a little ugly, but it serves to illustrate the
technique; feel free to adapt and mutate to best serve your own purposes!


    cheers,
      DaveK
-- 
Can't think of a witty .sigline today....



More information about the Cygwin-talk mailing list