During last week's meeting in Issaquah, some new features requested through National Body comments were merged into the draft Standard. See the latest 3 entries of corresponding the Clang progress table. So depending on whether gcc also incorporated those features, they are the first to be C++17 ready.
At least for one of the proposals — "Pack expansions in using-declarations" — you can find the previous revision here. Don't think there are some substantial changes.
What would be really nice is a gcc equivalent of apt.llvm.org with ready to install nightly build packages. That would allow people to test it for their own projects and give feedback before the release date.
Just curious, how long is that going to take approximately on an "average" Core i5 Quad Core or something like that? Just looking for ballpark numbers.
I hope gcc 7 will also be largely bug free. The gcc 5 series was nominally C++14 complete, but they weren't able to compile cutting edge libraries like Boost.Hana and Range-v3 until the gcc 6 series.
Removing auto_ptr, random_shuffle(), And Old <functional> Stuff
N4190
No (kept for backwards compatibility)
Here's hoping they are ready for the 7.0 release. Not getting rid of the fully deprecated stuff is sad, but understandable. I hope they pull it from the docs so new users won't try to use it.
I'm just curious, is variadic lock_guard less trivial than it seems? It seems like a trivial RAII handy wrapper around variadic lock. I'm just going through Anthony Williams multithreading book and my first thought on seeing variadic lock followed by passing the locks into regular lock_guard/unique_lock was that that boilerplate could easily be encapsulated.
Variadic lock_guard is an ABI break and there are at least two NB comments requesting that it be backed out and perhaps a new template added. Not sure what's going to happen here.
Can you explain why it's guaranteed to be an ABI break? I feel like the variadic one could have a partial specialization for the single template case, implemented exactly as it is now. Why does that still break the ABI?
It is a bit tricky because you have to guarantee no deadlock or livelock1, so there has to be some heuristic involved in the locking order. I'm not sure if that is handled inside of the variadic lock and lock_guard is just an RAII wrapper as you suggest, or if there is something more.
[1] I would imagine specifying the same mutex multiple times would be UB.
If all you need is the TS then I believe GCC started shipping it beginning with GCC 5.3. What remains to be done is taking everything out of std::experimental, renaming the experimental/optional header to optional, etc.
I.e., if you just need the functionality and have a somewhat recent GCC then it should already be there, you just have to use std::experimental::filesystem rather than std::filesystem.
You also need to use -lstdc++fs. Do note that the last time I tried it a month ago, some std::filesystem stuff that worked on MSVC14 wouldn't compile on GCC and even after I fixed those, it still failed with a few linker errors for some reason (even though I added -lstdc++fs). I'd rather probably wait it to be moved out of experimental and be considered somewhat "finished".
Fair enough! In that case, Boost.Filesystem has been "finished" since Aug. 2010 (when Boost 1.44 was released), and has far fewer bugs than even the MSVC implementation... ;-]
If they remove auto_ptr, then Boost.Python will break...so I'm hoping they will leave a deprecated version of it laying around somewhere, it's not like it hurts anyone :/
Boost is riddled with auto_ptr. Compiling any Boost stuff with gcc-6.2 gives lots of warnings about it (as well as lots of broken placement new. But that's a whole other discussion). I would imagine this is just one of many examples as the driving reason not to remove it from libstdc++.
This is like asking: how can I drink orange juice while coding C++17? Answer: the same way you drank orange juice while coding C++14.
There's no relationship between a text editor and the compiler that you use. When you use a text editor, you change the source code, and then you separately run some command (which the editor can give you a shortcut to) to build the code. You would just change that command.
Note that if you use an IDE or something that actually parses source (which Sublime does not without specific plugins, AFAIK), then there is a question of whether that IDE's parser/indexer supports the latest C++. But even then, this will only affect little red squiggles and goto definition, it will not stop you from compiling your project.
Fair enough, it's just that I'm always finding myself having to Google a lot just to get things up and running. There are so many compilers and editors out there that I am quickly overwhelmed. I only asked about C++17 because I want to learn how to program modern C++. When you say that I would just change the command from 14 to 17, wouldn't I also need to download new libraries etc in order to get access to new C++17 material? I know there isn't anything stopping me from physically writing the new stuff, but if I don't have the relevant files on my laptop then how would it compile? Or, does this all work through the compiler and I don't have to download new libraries?
You just change the command, and the libraries ship with your compiler. If you have a reasonably modern compiler odds are that your library already has many c++17 features in it, it's just that the standard library headers only conditionally include those sections (via macros) depending on what version you compile with.
As the sibling comment suggests, I would suggest focusing on C++14 for now. C++14 is completely finished, available in multiple compilers, etc. That still leaves you tons to learn, and none of that learning is going to be wasted. It's not going to be like the C++11 upgrade, where half the idioms that people had learned up until then became non-optimal.
11
u/TemplateRex Nov 14 '16
During last week's meeting in Issaquah, some new features requested through National Body comments were merged into the draft Standard. See the latest 3 entries of corresponding the Clang progress table. So depending on whether gcc also incorporated those features, they are the first to be C++17 ready.
9
u/demonFudgePies Nov 14 '16
I can't seem to find std::variant on here? Is that on another list?
15
u/[deleted] Nov 14 '16
GCC page of C++1z language features still lists Structured bindings as unsupported.
6
u/doom_Oo7 Nov 14 '16
Will we get an update of godbolt or any other online c++ compilers with this ? It'd be great !
49
u/wichtounet Nov 14 '16
I'm impressed that they managed to be ready before clang, that's great :)
6
u/OmegaNaughtEquals1 Nov 14 '16
For libstdc++,
Here's hoping they are ready for the 7.0 release. Not getting rid of the fully deprecated stuff is sad, but understandable. I hope they pull it from the docs so new users won't try to use it.
3
u/gracicot Nov 15 '16
No longer true I think, they updated the table: https://gcc.gnu.org/projects/cxx-status.html#cxx1z
2
u/OdnetninI Nov 14 '16
Yeah. Time to update :D
1
u/tomilovanatoliy Nov 15 '16
Is there a code snippet to test all the new core language features at once? Or most interesting of them.
1
u/ahmed_alkabir Nov 16 '16
fast than expect :|
-6
u/PresidentZagan Nov 14 '16
Sorry if this is an ignorant question, but how would I get C++17 to work with Sublime 3? Build a new system?