How can I generate a list via the C preprocessor (cpp)?

前端 未结 5 2121
慢半拍i
慢半拍i 2020-12-09 11:12

I would like to do something like the following:

F_BEGIN

F(f1) {some code}
F(f2) {some code}
...
F(fn) {some code}

F_END

and have it gene

5条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-09 12:10

    Boost is a C++ library, but it's Preprocessor module should still be good for use in C. It offers some surprisingly advanced data types and functionality for use in the preprocessor. You could check it out.

提交回复
热议问题