S
Sachin Garg
I need to build two executables from my code, one having all the code (and
thus application features) and other not having it all. How to best manage
the code that shouldn't go in one of the executables?
My first thought is to use conditional compilation with #define and #ifdef
etc but its getting messy, are there better ways to manage this?
The problem in detail:
#. There is a class A with virtual foo1 and foo2
#. There are 'lots' of derived classes of A which implement foo1 and foo2
#. Executable1 needs to use both foo1 and foo2
#. Executable2 only needs to use foo1, never needs foo2
How to make sure that all the foo2 code never gets into executable2? Lots of
#ifdefs can be used for this but is there a better solution? Maybe some
clever use of templates? Something else less complicated?
Thanks
thus application features) and other not having it all. How to best manage
the code that shouldn't go in one of the executables?
My first thought is to use conditional compilation with #define and #ifdef
etc but its getting messy, are there better ways to manage this?
The problem in detail:
#. There is a class A with virtual foo1 and foo2
#. There are 'lots' of derived classes of A which implement foo1 and foo2
#. Executable1 needs to use both foo1 and foo2
#. Executable2 only needs to use foo1, never needs foo2
How to make sure that all the foo2 code never gets into executable2? Lots of
#ifdefs can be used for this but is there a better solution? Maybe some
clever use of templates? Something else less complicated?
Thanks