Thank you for the article! One more question: Testing it on wandbox, I've seen that it works with the compiler option c++2a but doesn't work for c++17. Is there any way to deal with it for the c++17?
You're very welcome. This feature was introduced in C++14 for ordered containers like std::map and std::set, and later in C++20 for unordered containers like std::unordered_map and std::unordered_set according to https://en.cppreference.com/w/cpp/functional.html#Transparent_function_objects. If you need it for earlier versions of C++ standard, I'd recommend to using 3rd party libraries like abseil or folly, since std collections are inefficient anyways and shouldn't be used for performance-sensitive applications.
Thank you for the article! One more question: Testing it on wandbox, I've seen that it works with the compiler option c++2a but doesn't work for c++17. Is there any way to deal with it for the c++17?
Thank you for the article! One more question: Testing it on wandbox, I've seen that it works with the compiler option c++2a but doesn't work for c++17. Is there any way to deal with it for the c++17?
oops, looks like substack ate a few words. I meant to say that strings are severely overused. Sometimes I argue that they shouldn't even have native support in programming languages so that programmers have natural friction when trying to use them. But it's a long rent for a separate article.
Thanks for posting. This is something that we all need to keep in mind.
It was added to 14 for the ordered containers (map, set) and was added to the unordered ones in 20.
yep and unfortunately it's easy to miss in case of implicit conversions. Making everything explicit is my top hope for future C++.
Thank you for the article! One more question: Testing it on wandbox, I've seen that it works with the compiler option c++2a but doesn't work for c++17. Is there any way to deal with it for the c++17?
You're very welcome. This feature was introduced in C++14 for ordered containers like std::map and std::set, and later in C++20 for unordered containers like std::unordered_map and std::unordered_set according to https://en.cppreference.com/w/cpp/functional.html#Transparent_function_objects. If you need it for earlier versions of C++ standard, I'd recommend to using 3rd party libraries like abseil or folly, since std collections are inefficient anyways and shouldn't be used for performance-sensitive applications.
Thank you for the article! One more question: Testing it on wandbox, I've seen that it works with the compiler option c++2a but doesn't work for c++17. Is there any way to deal with it for the c++17?
Thank you for the article! One more question: Testing it on wandbox, I've seen that it works with the compiler option c++2a but doesn't work for c++17. Is there any way to deal with it for the c++17?
Strings are severely what? :)
oops, looks like substack ate a few words. I meant to say that strings are severely overused. Sometimes I argue that they shouldn't even have native support in programming languages so that programmers have natural friction when trying to use them. But it's a long rent for a separate article.