renzev@lemmy.world to Programmer Humor@lemmy.mlEnglish · 2 years agoSolutions? Where we're going, we don't need solutions.lemmy.worldimagemessage-square204fedilinkarrow-up11.15Karrow-down152file-text
arrow-up11.1Karrow-down1imageSolutions? Where we're going, we don't need solutions.lemmy.worldrenzev@lemmy.world to Programmer Humor@lemmy.mlEnglish · 2 years agomessage-square204fedilinkfile-text
Please dont take this seriously guys its just a dumb meme I haven’t written a single line of code in half of these languages
minus-squarenintendiator@feddit.cllinkfedilinkEnglisharrow-up27arrow-down1·edit-22 years agoC: Problem → return Solution; C++: Problem → const [auto]&& (Problem&& problem) noexcept(noexcept( Solution<Problem>{}(std::forward<Problem>(problem)) )) { return Solution<Problem>{}(std::forward<Problem>(problem)); } -> decltype( Solution<Problem>{}(std::forward<Problem>(problem)) )
minus-squareVenia Silente@lemm.eelinkfedilinkEnglisharrow-up5·2 years agoBut this doesn’t return the Solution. You don’t invoke the lambda. (Or does C++ have implied returns now? Last I heard there was implied move)
minus-squarenintendiator@feddit.cllinkfedilinkEnglisharrow-up2·2 years agoActually I do; it’s the {} that initializes the lambda, and the parenthesis after invokes. That said, it would have been fun.
C:
Problem→return Solution;C++:
Problem→const [auto]&& (Problem&& problem) noexcept(noexcept( Solution<Problem>{}(std::forward<Problem>(problem)) )) { return Solution<Problem>{}(std::forward<Problem>(problem)); } -> decltype( Solution<Problem>{}(std::forward<Problem>(problem)) )C:
return *(solution_t*)&problem;Maximum optimization!
But this doesn’t return the
Solution. You don’t invoke the lambda.(Or does C++ have implied returns now? Last I heard there was implied
move)Actually I do; it’s the
{}that initializes the lambda, and the parenthesis after invokes.That said, it would have been fun.