#include "./templates_b.h" #ifdef B_WITH_HELPER // Compile gcc main_b.cpp -DB_WITH_HELPER // This would normally be in its own impl - in the main for simplicity int do_foo(LocalTypeB bb) { // This is where I'd rather the detailed business logic be return 9001; } #endif #ifdef B_IN_IMPL // Compile gcc main_b.cpp -DB_IN_IMPL // This would normally be in its own impl - in the main for simplicity int do_foo(LocalTypeB bb) { return 9001; } #endif int main() { do_foo(0.0); do_foo(LocalTypeB()); return 0; }