Quantcast
Channel: Active questions tagged gcc - Stack Overflow
Viewing all articles
Browse latest Browse all 22267

Generating code at compile-time using scripts

$
0
0

I would ideally like to be able to add (very repetitive) C/C++ code to my actual code, but at compile time, code which would come from say, the stdout of a python script, the same way one does with macros.

For example, let's say I want to have functions that depend on the public attributes of a given class, being able to just write the following in my C++ code would be a blessing:

generate_boring_functions(FooBarClass,"FooBarClass.cpp")

Is that feasible using conventional means? Or must I hack with Makefiles and temporary source files?

Thanks.


Viewing all articles
Browse latest Browse all 22267

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>