4 ms·
std::move is just syntax sugar over static_cast<T&&>(t) ; the language feature that needs library support afaik are: - Overloading some of the "new" operators
by jcelerier 4y ago
std::move is just syntax sugar over static_cast<T&&>(t) ; the language feature that needs library support afaik are:
- Overloading some of the "new" operators (need #include <new>)
- <initializer_list>
- typeid which needs <typeinfo> as you said
I don't see which parts of the language need pair and tuple at all?
- deadbeeves 4y agoI was mistaken. I thought you needed std::tuple for structured binding, but it seems the language can also destructure other types.
- jcelerier 4y agoit's not that you need it, it's that when destructuring, std::tuple_size / std::tuple_element are implicitly checked to see how destructuring can be made to work if you have a type with some custom destructuring. (example: https://gcc.godbolt.org/z/5jq61oox7 https://gcc.godbolt.org/z/5jq61oox7) If they are not available or just not overloaded (e.g. when destructuring some basic struct) it just falls back to the destructuring one expects. So you need <tuple> for the specific case of implementing custom destructuring, that is one more case to add to the list :)
- quest88 4y agoThis whole thread is why c++ is..bad. It just leaves me with a sense of hopelessness.
- deadbeeves 4y agoYou're being overdramatic. You don't need to be a language lawyer to use C++ correctly and effectively.
- jcelerier 4y agoWhich language do you use?
- arinlen 4y ago> This whole thread is why c++ is..bad. It just leaves me with a sense of hopelessness. You've tried to force your personal misconceptions as some kind of gotchas that justify you irrational dislike for a programming language, and once each and every misconception you had was dispelled and debunked, your reaction was to double-down on your irrational belief. This does not flag failures in a language.
- Dylan16807 4y ago? That's their only comment on the entire page.