News for hackers. Stuff that matters.
Re:Functional programming in C++ by hellofunk on Monday September 26, 2016 @09:55AM (#12581800)
take a look at one of the macros this library depends on:

https://github.com/kennytm/utils/blob/master/traits.hpp#L47-...

Wow that scares the heck out of me to do that!

Re:Functional programming in C++ by PeCaN on Monday September 26, 2016 @12:42PM (#12583346)
What? 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 (Yes, that's code from a project I work on. Don't ask.)

Re:Functional programming in C++ by hellofunk on Monday September 26, 2016 @02:15PM (#12584213)
I 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.
Re:Functional programming in C++ by beached_whale on Monday September 26, 2016 @10:45AM (#12582224)
I'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.