Live data from Hacker News

C++17 Standard Published

iso.org

61–70 of 85 posts

Re: C++17 Standard Published

#61

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 th…

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 goo…

> basically all the symbols you can find on a keyboard

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

Re: C++17 Standard Published

#62
post #18

Earlier quoted context omitted.

It still is pretty sweet for polyglot developers.

How so?

On my case, C++ only gets used to do low level stuff as library to integrate into Java and .NET applications.

So modules and concepts were nice to have, but C++17 is already a very good improvement to write such kind of libraries.

Re: C++17 Standard Published

#63
post #47

The way coroutines are implemented in C++17 is just beautiful. Minimal language changes, compatible down to C function pointers and void*, and extensible to almost any existing asynchronous library via trait specialisation.

Didn’t coroutines get pushed out to at least c++20?

Re: C++17 Standard Published

#64
post #56

Earlier quoted context omitted.

Nope. They just got a minor update.

Are my eyes failing me? > C++17 includes the following new language features: > ... > utf-8 character literals > ... > char x = u8'x';

C++11 introduced utf-8 encoded string literals. However, when the parser was reading the characters in the literal, they were interpreted in whatever character set encoding the compiler was using (you could use escaped characters to represent unicode characters that had no representation in that encoding).

Re: C++17 Standard Published

#65
post #42
post #35

Do any of the standard's people read HN, or is there a way of submitting requests? The STL could seriously use some improvements. std::string doesn't do most of the stuff you want with a string; updating it to an interface like Python's string would be nice. Having a std::vector::append() would be really nice, so I don't have to remember that C++ uses something completely different from every other language. Convenie…

> I'm wondering if we ought to start thinking about a C++2.0 where we can write the C++ that we've learned we want. Wasn't that the incentive behind the D language?

Well, since D is garbage collected, it really exists in a different world from C++, so I'd say that no, it is not qualified to be in the running for a C++ 2.0.

Re: C++17 Standard Published

#66
post #47

The way coroutines are implemented in C++17 is just beautiful. Minimal language changes, compatible down to C function pointers and void*, and extensible to almost any existing asynchronous library via trait specialisation.

There are no coroutines in C++17. Also not included: modules and concepts.

Re: C++17 Standard Published

#67
post #35

Do any of the standard's people read HN, or is there a way of submitting requests? The STL could seriously use some improvements. std::string doesn't do most of the stuff you want with a string; updating it to an interface like Python's string would be nice. Having a std::vector::append() would be really nice, so I don't have to remember that C++ uses something completely different from every other language. Convenie…

> but I'm wondering if we ought to start thinking about a C++2.0 where we can write the C++ that we've learned we want

or... you could just use any of the dozens of libraries that already has the API you want (append, contains... they are all in Qt for instance). Why wait for it to standardize ? it's already here and you can use it.

Re: C++17 Standard Published

#68
post #48

Earlier quoted context omitted.

Thanks. I just like having an official (not draft) copy. I'm a nerd. I just built from the LaTeX source and it's 32 pages longer than the public draft in the second link from 6 weeks ago. Maybe just additional descriptive language, but...

The C++ draft and published standard are so similar, the only parties I imagine would need the published copy are gcc frontend developers, technical managers at IBM, etc. As an individual who gets into the deep dark crevices of C++, I've never needed the tiny details the published standard offers. They are mostly typographical.

iirc even gcc devs don't have it and use the draft

Re: C++17 Standard Published

#69

Earlier quoted context omitted.

Its not std::move, but the complexity coming with it. Its a hassle applying move semantics correctly and there is not the one goto solution for simple things. Im not aware of a proposal to change that issue, but at least there should be better defaults. This talk explains the pain quite well: https://www.youtube.com/watch?v=PNRju6_yn3o

The amount of prayer I have put into RVO and moves happening "right"... As someone who isn't a C++ programmer, is there anything better than looking at annotated asm? Templating everything and trying it with something that isn't copyable? (Actually, would that even work with RVO?)

> As someone who isn't a C++ programmer, is there anything better than looking at annotated asm

put a debug breakpoint in the move constructor and run your tests :p

Re: C++17 Standard Published

#70

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 th…

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 goo…

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.

Post reply on HN