The `std::byte` thing is really sad.
Both that it was adopted, and Herb holding it up as a kind of positive
achievement.
Looking at the feature set over at <url:
https://en.wikipedia.org/wiki/C%2B%2B17>:
• Now optional message for `static_assert`, too late. Everybody has some
macro, and it will still need to be used to support feature-lagging
compilers. Otherwise one can just use "!" as message.
• UTF-8 character literal is a way to restrict a character literal on
octet-based machines (just about all modern computers) to ASCII. It's
IMHO the most useless and silly concept in all of C++ history. It could
possibly have been useful if it was named mnemonically for ASCII, had
some corresponding constraint feature for strings, and worked as a
constraint also on 16-bit byte and 32-bit byte architectures.
<url:
https://isocpp.org/files/papers/n4267.html>
• Template fold expressions, sounds nice so one can avoid those silly
declare-an-array workarounds for pack transforms. But I guess the proof
is in the eating of the pudding. What does it really taste like, and
does it cause gas, or not?
• Initializers in conditions. That's ungood in itself, as I see it,
because it adds complicating syntax for something that can be simply
expressed without it. But, this feature can be abused to provide a
locally scoped variable declaration for a block guaranteed without any
overhead. That practically requires a macro like Expressive C++ `$with`,
or else writing painfully convoluted cryptic code, but still. This
feature is apparently an /enabling wart/! :)
• Template deduction of constructors, oh finally! Now /that/'s a nice
feature. No more silly factory functions, yay!
In the library, `std::string_view` is better than nothing, but has the
design problem of returning references instead of values, thus
preventing a later more sane string handling. Let's constrain things
just because we can. Ouch.
File system, hope that works out. It implies wide string constructors
for the fstreams, in Windows. Silly platform-specificity in a standard,
grumble. Yes I did something positive about it once: I filed a bug
report with Boost Filesystem, because BFS didn't work for the case of
international text filenames with MinGW g++, because that compiler's
standard library didn't have those wide string constructors. And I
created a workaround based on existing g++ extended standard library
functionality, so that's possible and shows that the Windows-specific
requirement of the C++17 standard isn't necessary at all: instead one
could have more general functionality, supporting more portable code.
The main problem I see is that at least the proposal used the phrasing
“/encouraged/ to provide” about the wide string constructors, and if
that's also the wording in the standard then one is not guaranteed that
international file names will work in Windows with g++. :(
- Alf (a bit disappointed)