Ranges and views from c++20 are cool. Today I have learned that C++23 brings even more fun stuff from python to c++. For example, zip and enumerate. These are some of the features from python that I missed the most in c++. Also, now there is a thing called cartesian product which helps one to avoid writing 5 nested loops.
I think these things could be pretty handy for competitive programming, so I would like to ask: what other features of c++23 do you find interesting? And when do you think we could get c++23 on Codeforces?
Time to drop my own
zip
andenumerate
functions :)that's cool man
Deducing this, std::flat_map, std::print
I've looked at std::flat_map and didn't understand the point. Is it just worse than std::map?
No. std::flat_map aims to enhance performance, especially for small collections, by utilizing a contiguous memory layout.
In some cases, this actually seems useful for finding a balance between time and memory. For example, it seems that it is better to use flat_map when storing edges at the node of a trie.
As far as I understand this is just an implementation like vector<pair<Key, Value>> with sorted Keys. And it works great with cache.