What do you want to be in C++ 17

Pages: 12
Apr 5, 2016 at 4:26pm
I was wondering what you would want to see be added to the C++ 17 standard. I would like to see auto functions/auto parameters I think it would be pretty cool. I know there are templates but I feel like auto could make some things simpler whilst templates could be more specialized/complex.
Apr 5, 2016 at 7:18pm
A lot of people were hoping for Concepts, but they didn't make it for good reason:
https://www.reddit.com/r/cpp/comments/49b0ph/why_concepts_didnt_make_c17/d0qlse8

I'm personally hoping for modules but I'm not even sure they will make it either.

More info about what has been happening here:
https://www.reddit.com/r/cpp/comments/49dgdb/why_i_am_not_happy_with_c17_c_17_outlook_march/
Apr 6, 2016 at 3:09am
LB wrote:
they didn't make it for good reason:

I disagree with that, and the majority of the committee disagrees too.. unfortunately (or, sometimes, fortunately), passing requires more than majority.

The reason modules were punted to a TS was that Google can't let go of preprocessor macros. It's a strange era these days where Microsoft is coming up with major C++ innovations (modules and coroutines are both in their released compiler) and Google is blocking them in the name of backwards compatibility.
Last edited on Apr 6, 2016 at 3:21am
Apr 6, 2016 at 11:21am
I'm hoping that we don't see a graphics library. Ever, really.
Apr 7, 2016 at 8:41pm
Networking library would be nice to have. Ideally I would like to be able to get data from web and parse json or xml without external libraries.
Apr 8, 2016 at 12:49am
closed account (E0p9LyTq)
What would I want in C++17?

A Hot Blonde and the access code to a stuffed full numbered Swiss bank account.

Seriously, putting what people were looking for in C++14 that didn't make it would be a good start.
Apr 10, 2016 at 5:41am
closed account (1vD3vCM9)
I would like to have an official network library ( NOT BOOST ), and for files, std::exists() that will check if a file exists.
Apr 10, 2016 at 6:19am
C++17: std::filesystem::exists()
C++14 with Filesystem TS: std::experimental::filesystem::exists()
http://en.cppreference.com/w/cpp/experimental/fs/exists

(Filesystem (currently a TS) would be part of the standard library in C++17)
Apr 10, 2016 at 3:31pm
oren drobitsky wrote:
I would like to have an official network library ( NOT BOOST )

What library do you propose instead? How widely is it used?

to quote the draft of the C++ Networking Library technical specification,

The Boost.Asio library, from which this proposal is derived, has been deployed in numerous systems, from large (including internet-facing HTTP servers, instant messaging gateways and financial markets applications) to small (mobile phones and embedded systems). The Asio library supports, or has been ported to, many operating systems including Linux, Mac OS X, Windows (native), Windows Runtime, Solaris, FreeBSD, NetBSD, OpenBSD, HP-UX, Tru64, AIX, iOS, Android, WinCE, Symbian, vxWorks and QNX Neutrino.


(btw, since it's already part of C++17 working draft, cppreference also documents exists under http://en.cppreference.com/w/cpp/filesystem/exists - not in the index yet, though)
Apr 10, 2016 at 8:56pm
I don't think that I want to see a networking library tacked onto the standard library.
Apr 11, 2016 at 12:35am
If a networking library gets added to the standard library, I'm probably going to be ignoring it more than half the time. I don't think networking is something where you can just pick one interface and have it cover all bases - nearly every networking library I have seen has been different enough that switching from one to the other is not trivial. Each has their strengths and weaknesses and was designed to suit a particular set of purposes. I can see the appeal of having a standard networking library but I just think it's a bad idea. What's next, a standard graphics library?

I've also heard people say that adding a networking library to the standard would be good for C++ because of the IoT...but aren't IoT devices usually systems where the standard library isn't even available in the first place?
Apr 11, 2016 at 12:47am
I use ASIO for literally everything. I've yet to run into any issues that it doesn't handle. It also handles multiplexing file IO as well... what kind of issues can you think of that you would run into?

EDIT: That said, I'm actually against adding a networking library since I'd probably end up using ASIO anyways for the next decade until every compiler has a working optimized version of pretty much the exact same thing.
Last edited on Apr 11, 2016 at 12:51am
Apr 18, 2016 at 6:51am
closed account (1vD3vCM9)
I can't stand Boost, and I'll never use it.
It just seems that everyone is giving an Boost solution to EVERYTHING.
Don't get me wrong the library itself is good, but Linus Torvalds said himself, when he spoken about C++, that almost all C++ programmers use Boost and STL and get distracted from doing actual programming.
Apr 18, 2016 at 1:08pm
Torvalds hates C++, and I'm not sure he'd hate it less if there wasn't a Boost. I'm not sure what he considers 'real programming' but if he's wearing an onion belt while saying it I'm going to take it with a grain of salt.
Apr 18, 2016 at 8:13pm
closed account (E0p9LyTq)
LB wrote:
Torvalds hates C++


Ah, the irony of the sneering at C++ by "real programmers."

http://www.cplusplus.com/forum/lounge/188979/
May 10, 2016 at 6:23pm
closed account (E0p9LyTq)
C++11 included a single dimension fixed size array container into the STL, why not include a multi-dimension array template in C++17?
May 10, 2016 at 6:28pm
Can't you just use std::array<std::array<int,3>,3>?
May 10, 2016 at 8:47pm
There is a proposal for multidimensional array views http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0009r1.html
it was reviewed mosty positively, but there is still work to do, so it didn't make the C++17 cutoff: https://issues.isocpp.org/show_bug.cgi?id=80
May 11, 2016 at 12:54am
closed account (E0p9LyTq)
Nice to see the idea was reviewed, too bad it wasn't ready for prime-time with C++17.

The proposal does look promising.
Jun 11, 2016 at 6:12pm
closed account (E0p9LyTq)
shadowmouse wrote:
Can't you just use std::array<std::array<int,3>,3>?

I could, but then AFAIK the array's fill() modifier wouldn't work as designed.

The workaround using multiple for statements, as is needed with "raw" multidimensional arrays, would work as expected.

What if you want an array that is [2][4]? The initialization is counter-intuitive:
std::array<std::array<int, 4>, 2> myarray {};

Multidimensional arrays of more than two dimensions gets even more IMO "hackish," [3][2][4]:
std::array<std::array<std::array<int, 4>, 2>, 3>

It would be nice to have multidimensional STL arrays be a part of the standard, a dream would be having dynamic containers be multidimensional as well.
Last edited on Jun 11, 2016 at 7:03pm
Pages: 12