Namespaces
Variants
Views
Actions

Talk:cpp/container/multimap/insert

From cppreference.com

Should we revert the last change in the example to use std::make_pair? The use of std::pair in the example now only works with at least C++17 leaving a compile error for C++11 and C++14 mode. Bolry (talk) 03:12, 17 November 2021 (PST)

There is no need to. It is usually OK to use the latest ISO revision (thus C++20) in the examples, or even to exploit some features from C++/next in case they are supported by the attached on-line compilers (presently g++-11.2, clang++-5.0). There are a lot of examples here that already use C++20/2b.
This way we "advertise" and "promote" (post-)modern C++. :)
Sometimes it even makes sense to modernize "old" examples, although, this is not the main priority.
From the other side, the code in "Possible Implementation" sections should strictly follow the C++ revision at which the implemented feature was introduced. --Space Mission (talk) 14:44, 17 November 2021 (PST)