C++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 :/.
What are concepts? Is it like java/golang interfaces or rust traits?
C++17 Standard Published
31–40 of 85 posts
Re: C++17 Standard Published
#32C++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 :/.
https://dlang.org/concepts.html
You should give D metaprogramming a try. It's a whole new world, a new fantastic point of view.
Re: C++17 Standard Published
#33Re: C++17 Standard Published
#34C++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 :/.
D has had concepts for quite a while. They call them template constraints: https://dlang.org/concepts.html You should give D metaprogramming a try. It's a whole new world, a new fantastic point of view.
Re: C++17 Standard Published
#35I'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.
Re: C++17 Standard Published
#36Earlier quoted context omitted.
D has had concepts for quite a while. They call them template constraints: https://dlang.org/concepts.html You should give D metaprogramming a try. It's a whole new world, a new fantastic point of view.
That looks really interesting. Is this all done at compile time or runtime? After further reading the answer seems to be compile.
Re: C++17 Standard Published
#37Do 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…
Re: C++17 Standard Published
#38Do 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 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.
Re: C++17 Standard Published
#39Do 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…
std::set does have a contains() function, it's called count(): http://en.cppreference.com/w/cpp/container/set/count
Re: C++17 Standard Published
#40Earlier quoted context omitted.
It's not as major of an update as previous releases, but there are a lot of little convenience features. String views, same-line nested namespaces, [[fallthrough]], if with init (I'm sure Google single-handedly got this included; it's very Go-reminiscent and really nice when not using exceptions), structured bindings, maybes with std::optional (occasionally useful), and even just something as simple as emplace return…
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