8 ms·
C++17 Standard Published
- w8rbt 9y agoAwesome news. Long live C++ ;)
- mratzloff 9y agoI can't even imagine the amount of work that goes into producing a specification like this, BUT... I wish there were a reduced price option for individuals. I just can't justify spending USD 200 on getting a copy for myself. I'd love to have a copy so I don't have to rely on second-hand sources like websites and implementation details from STL maintainers on Reddit or Stack Overflow.
- pavanky 9y agoYou can probably build the drafts from the github repo: https://github.com/cplusplus/draft/tree/c++17 https://github.com/cplusplus/draft/tree/c++17
- avar 9y agoThe reduced price option for individuals is that you just look at the last working draft, which is always published for free for all ISO standards and is almost equivalent to the final product. The only reason anyone cares about the officially published standard is if you're a compiler vendor who wants to know for sure that your product is standards compliant, which is why the cost for the no-draft versions is what it is.
- prginthebox 9y agoThe almost equivalent is always the scary part. Is there a guarantee that there is no technical difference between the draft and final standard? From your reply, it seems, it is intentionally not specified what exactly are the differences to force compiler vendor to buy the standards. But then the one using a draft is always scared there is one thing different which he has not looked into and this is causing problems somehow.
- johannes1234321 9y agoNon-editorial changes would have to be voted in. This is not an easy process which can happen late. And mind: It's not only for compiler vendors. An ISO standard is a legal document. Based on your country you might put in your software's contract that your code is compliant C++ code or might consult the standard in a legal debate with a commercial vendor. All quite limited ... but not only compiler vendors.
- m-ou-se 9y agoYou can build the pdf yourself from the LaTeX source: https://github.com/cplusplus/draft https://github.com/cplusplus/draft Or get the latest public draft from https://wg21.link/standard https://wg21.link/standard Or an html version: http://eelis.net/c++draft/ http://eelis.net/c++draft/
- mratzloff 9y agoThanks. 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...
- Someone 9y agoReading https://github.com/cplusplus/draft https://github.com/cplusplus/draft, it seems you had to generate figures from their dot source. If so, the result may depend on your installation (probably even if you use the same version of GraphViz but a different OS and/or set of fonts), and that can affect pagination. Also, are you sure you built for the same paper size? A4 vs US letter could explain the difference.
- mratzloff 9y agoWell, you can see changes as recently as two days ago. https://github.com/cplusplus/draft/commit/83e302d3bb6a5f88554b1ec75e8aa51760458c5f https://github.com/cplusplus/draft/commit/83e302d3bb6a5f8855...
- vortico 9y agoThe 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.
- 9y ago
- deleted 9y ago[deleted]
- deleted 9y ago[deleted]
- bstamour 9y agoWhen C++11 came out, I bought the ANSI copy (identical to the ISO one except for the front page if I remember correctly) for $30. It sure beat the ISO version in terms of price.
- JamesUtah07 9y agoDo I really have to pay for a pdf of the standard? (sorry I just don't see anyway else to download the pdf)
- kachnuv_ocasek 9y agoYep. You can download the latest working draft from open-std.org though: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/n4700.pdf http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/n470...
- corndoge 9y agoSomeone will upload it on libgen within a few days
- w8rbt 9y agoThat is illegal.
- symlinkk 9y agoand?
- moocowtruck 9y agomaybe he's a lawman
- corndoge 9y agocool story
- kccqzy 9y agoJust go to https://github.com/cplusplus/draft https://github.com/cplusplus/draft for drafts. Choose a draft version that is produced right before the actual date of standardization and there are only very minor differences between the draft and the real deal.
- cominous 9y agoC++17 is a slight disappointment, I hope C++20 will be the real deal - concepts could really be a game changer and move semantics needs more fixes :/.
- pjmlp 9y agoIt still is pretty sweet for polyglot developers.
- VHRanger 9y agoHow so?
- cbsmith 9y agoThere aren't a lot of languages that combine functional programming/generics & OO together quite so extensively. There's a lot of power you can unlock there if you can just manage the cognitive load of the syntax.
- jordigh 9y agoI really like how D combines these two. The functional programming tools are a lot easier to use than C++ and a lot more practical than Haskell or OCaml. I absolutely adore the idea of purity in D: no side effects. That's all it should be, really. What this means is that it allows you to write pure functions in dirty, imperative ways as long as all the mutation is confined to the function and doesn't leak out. I really like it.
- wasx 9y agoAwesome news. gcc has had experimental support for C++17 for a while now, any idea on a potential time frame for it to move from experimental to final standards compliant?
- snarfy 9y agoThis summary has been helpful for me: C++17 https://github.com/AnthonyCalandra/modern-cpp-features/blob/master/CPP17.md https://github.com/AnthonyCalandra/modern-cpp-features/blob/... 17/14/11 https://github.com/AnthonyCalandra/modern-cpp-features https://github.com/AnthonyCalandra/modern-cpp-features
- prewett 9y agoDo 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. Convenience things like std::set::contains() would be nice because s.find() != s.end() is not very readable compared to contains(). I'm really impressed at what the standards committee has done, 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. The poor young-uns learning C++ still have to learn all the old stuff, because otherwise it will bite them sooner or later.
- TheAsprngHacker 9y agoThe process for proposals is at https://isocpp.org/std/submit-a-proposal https://isocpp.org/std/submit-a-proposal
- repsilat 9y ago> std::set::contains() I live in a "fast languages only when necessary, and with restraint" shop. Our C++ is not idiomatic, it is meant for programmers from other languages. Anything with iterators is a bit sketchy. It tends to look more like C than C++, and now that I'm an old person I am perfectly happy with that. We use `s.count(i) == 1`. It's ok -- clear, readable etc. Doesn't give you an iterator if you want to delete the thing too, but most of the time you don't.
- vadimberman 9y agoReally, UTF literals only now?
- cbsmith 9y agoNope. They just got a minor update.
- vadimberman 9y agoAre my eyes failing me? > C++17 includes the following new language features: > ... > utf-8 character literals > ... > char x = u8'x';
- cbsmith 9y agoC++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).
- nly 9y agoThe 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.
- mattbierner 9y agoDidn’t coroutines get pushed out to at least c++20?
- nly 9y agoYeah, technically it's a TS, but it's live in MSVC 2015/17 and Clang 5.0
- hellofunk 9y agoThere are no coroutines in C++17. Also not included: modules and concepts.
- 75dvtwin 9y agoSeems 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(); }; };
- wtarreau 9y agoBah 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".
- m-ou-se 9y ago> basically all the symbols you can find on a keyboard C++ doesn't even use @ and $, yet ;)
- krylon 9y agoI 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.
- andrewjw 9y agoCan you explain what your code example would be used for (instead of just plus)?
- HalcyonicStorm 9y agoCan someone kindly post links or books for a beginner to dive into learning C++? It is a bit intimidating to approach fresh.
- parasight 9y agoI'd recommend to choose one of these two books: Programming: Principles and Practice Using C++, 2nd Ed., Bjarne Stroustrup https://www.amazon.com/Programming-Principles-Practice-Using-2nd/dp/0321992784/ref=pd_sim_14_3?_encoding=UTF8&pd_rd_i=0321992784&pd_rd_r=DESRRXNFC61DR4BDRFY2&pd_rd_w=ykzg4&pd_rd_wg=9Nllh&psc=1&refRID=DESRRXNFC61DR4BDRFY2 https://www.amazon.com/Programming-Principles-Practice-Using... C++ Primer, 5th Ed., Stanley Lippman https://www.amazon.com/Primer-5th-Stanley-B-Lippman/dp/0321714113/ref=pd_sim_14_7?_encoding=UTF8&pd_rd_i=0321714113&pd_rd_r=DESRRXNFC61DR4BDRFY2&pd_rd_w=ykzg4&pd_rd_wg=9Nllh&psc=1&refRID=DESRRXNFC61DR4BDRFY2 https://www.amazon.com/Primer-5th-Stanley-B-Lippman/dp/03217... For a very brief introduction: A Tour of C++, Bjarne Stroustrup https://www.amazon.com/Tour-C-Depth/dp/0321958314/ref=sr_1_1?ie=UTF8&qid=1512544081&sr=8-1&keywords=C%2B%2B+tour https://www.amazon.com/Tour-C-Depth/dp/0321958314/ref=sr_1_1...
- sn9 9y agoHere's more info regarding book recs: https://isocpp.org/wiki/faq/how-to-learn-cpp#best-book https://isocpp.org/wiki/faq/how-to-learn-cpp#best-book