纯 C 语言的预处理器元编程库
有谁知道类似于 boost::preprocessor
的库(可能不是那么先进),可以轻松地在纯 C 项目中使用/合并? 当然,大多数(全部?) boost::preprocessor
在用 C 编写时是可用的,但我更喜欢一个仅具有不依赖于的基本功能的小型库对怪物之类的提升。
Does anybody know a library similar to boost::preprocessor
(maybe not so advanced) that could be easily used/incorporated in plain C projects?
Of course, the most (all ?) of boost::preprocessor
is usable when writing in C but I would prefer a small library with only basic capabilities that doesn't depend on the monster like boost.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我建议你使用Boost.Preprocessor。不要以为我没有完全阅读你的问题。我建议您单独使用 Boost.Preprocessor,而不是整个 boost 包。为此,您可以使用名为 bcp 的小实用程序 它允许您提取所需的库,在您的例子中是 Boost.Preprocessor。
I suggest you use Boost.Preprocessor. Don't think i haven't read your question entirely. I suggest you use Boost.Preprocessor alone, not the whole boost package. In order to do that, you can use a small utility called bcp which lets you extract the libraries that you need, in your case Boost.Preprocessor.
您始终可以使用 bcp 从 boost 中提取组件,不过,说实话,我还没有用 Boost.Preprocessor 进行过测试。
我认为您将很难找到像 boosts 一样可移植的其他实现。
You can always extract components out of boost using bcp, though, to be honest, i haven't tested that with Boost.Preprocessor yet.
I think you will have a hard time to find other implementations that are as portable as boosts.
我想到了 P99 (http://p99.gforge.inria.fr/)。
引用:
P99 (http://p99.gforge.inria.fr/) comes to mind.
Quote: