News for hackers. Stuff that matters.
Re:C++17 Standard Published by 75dvtwin on Wednesday December 06, 2017 @12:29AM (#15858772)
Seems like the meta-language (compile-time expressions) is now pretty much full fledged.

Long gone days where template meta-programming was the only way to do compile-time code generation and constant checks.... at least that's my impression of the latest language-level features.

I have not worked professionally with c++ for a few years now, but his piece from the article, just seems rather powerful incarnation of the compile-time programming.

  constexpr auto add = [] (int x, int y) {
    auto L = [=] { return x; };
    auto R = [=] { return y; };
    return [=] { return L() + R(); };
  };
Re:C++17 Standard Published by andrewjw on Thursday December 07, 2017 @03:21PM (#15873703)
Can you explain what your code example would be used for (instead of just plus)?
Re:C++17 Standard Published by wtarreau on Wednesday December 06, 2017 @01:27AM (#15859027)
Bah what an horror. I doubt anyone can spot a more unreadable language (except maybe brainfuck).

One of the issues I have with C++ is that they seem to have used basically all the symbols you can find on a keyboard to create unspellable operators or modifiers, and since they didn't have enough to avoid colliding with C, they mixed them to create even more unreadable combinations. The other examples in the doc are good readings as well suggesting I never approach this "modern art".

Re:C++17 Standard Published by krylon on Wednesday December 06, 2017 @07:13AM (#15860511)
I think the reason is that adding new keywords to the language always means the risk of breaking somebody's code.

I can see why a standardization body would want to avoid that, even though I agree wholeheartedly the result is not pretty.

Re:C++17 Standard Published by m-ou-se on Wednesday December 06, 2017 @02:35AM (#15859270)
> basically all the symbols you can find on a keyboard

C++ doesn't even use @ and $, yet ;)