3 ms·
take a look at one of the macros this library depends on: https://github.com/kennytm/utils/blob/master/traits.hpp#L47-L53 https://github.com/kennytm/utils/blob
by hellofunk 10y ago
take a look at one of the macros this library depends on:
https://github.com/kennytm/utils/blob/master/traits.hpp#L47-L53 https://github.com/kennytm/utils/blob/master/traits.hpp#L47-...
Wow that scares the heck out of me to do that!
- beached_whale 10y agoI've done that, usually I will put an undef after so that the macro's scope is limited. As far as macro's go, that is not so bad and generating the exact same code over and over is asking for errors too. Not sure of how else to do something like that, but I could be ignorant.
- PeCaN 10y agoWhat? That macro is super straightforward. Yes, generating C++ templates from CPP macros is a little ugly, but it's not particularly hard to understand. CPP macros only start to get weird once you start implementing control structures in them. http://pastebin.com/raw/tNaX99eA http://pastebin.com/raw/tNaX99eA (Yes, that's code from a project I work on. Don't ask.)
- hellofunk 10y agoI didn't say it was hard to understand; but it does scare me to depend on any C-style macro like that in a C++ project.