Skip to main content

Timeline for Simple lambda like define trick

Current License: CC BY-SA 3.0

10 events
when toggle format what by license comment
Apr 25, 2017 at 17:29 comment added Mango ill look over it tomorrow, by now i am done for today^^
Apr 25, 2017 at 17:27 comment added Mango how i said, i just removed the defines for public private^^ then it worked (that was no offence btw. i am just confused)
Apr 25, 2017 at 17:05 comment added Loki Astari I have no idea why it is not compiling either. But the code you have supplied does not compile as is. You should try cutting and pasting the code you have supplied in the above answer into codepad . Actually let me do it for you: codepad.remoteinterview.io/YXUIBJJNNM Note I was being generous in my review above as I fixed a couple of things before reporting the errors.
Apr 25, 2017 at 16:00 comment added Mango Okay watch, I have no clue what you are doing with your compiler or which you are using so I simply can't tell you why it isn't working on your IDE. codepad.remoteinterview is using gcc as far as I know and it had (besides the public_function) no issue compiling it, as well as vs2010, vs2013 and vs2015. I had little to no issues with the macro, and yes, the performance suffers.
Apr 25, 2017 at 15:56 comment added Loki Astari using your lambda macros just causes issues. 1) does not save you significant typing. 2) Adds lots of extra complexity 3) Is very inefficient due to all the copying and calls to new. 4) Will not work on standards compliant compilers. 5) Compiler error messages are non trivial to understand.
Apr 25, 2017 at 15:53 comment added Loki Astari Yoda conditionals don't help you in any way. There have been large articles written on the subject. Read this: softwareengineering.stackexchange.com/q/162256/12917
Apr 25, 2017 at 15:49 comment added Mango so where to start, I were used to do this public_function thing to get things cleaner (and I came to a similar conclusion like you did, I don't need it) but well, this code is a bit old, so sorry for that, second of all, I did not know that there is a std::bad_cast, again something learned, and the last thing I am going to address, the "yoda Conditionals" saved me a lot of trouble so they are useful for me at least. Thank you for pointing out the swapped public private sing, I never recognized that and well, I liked lambda(()){} more than writing a class , that's why i implemented it once.
Apr 25, 2017 at 15:47 history edited Loki Astari CC BY-SA 3.0
added 1 character in body
Apr 25, 2017 at 15:41 history edited Loki Astari CC BY-SA 3.0
added 804 characters in body
Apr 25, 2017 at 15:33 history answered Loki Astari CC BY-SA 3.0