Named idioms

Pimpl, copy-and-swap, erase-remove, overloaded, scope guards.

The canon, now with language support: pimpl via unique_ptr, copy-and-swap, Meyers singleton blessed by magic statics, erase-remove for containers, RAII scope guards.

v.erase(std::remove_if(v.begin(), v.end(), bad), v.end());  // erase-remove

Registry& instance() {
  static Registry r;      // magic static: thread-safe since C++11
  return r;
}

std::exchange becomes the micro-idiom inside move operations and resource stealing.

overloaded (via aggregate CTAD + pack expansion in using) becomes the standard visitor companion; std::scope_exit stays in a TS but the pattern is everywhere.

template <class... Ts> struct overloaded : Ts... { using Ts::operator()...; };
template <class... Ts> overloaded(Ts...) -> overloaded<Ts...>;  // pre-C++20

Library absorbs the idioms: std::erase_if kills erase-remove, starts_with/ends_with kill substring checks, [[no_unique_address]] replaces EBO-by-inheritance.

std::erase_if(v, bad);                    // the whole idiom, one call
struct Flat { [[no_unique_address]] Empty policy; };   // EBO without inheritance

More absorption: std::to_underlying (enum cast), std::unreachable (the UB hint), std::byteswap, monadic optional replacing hand-rolled chains.

#embed retires the xxd-generated byte-array idiom; std::inplace_vector retires hand-written fixed-capacity vectors.

static constexpr unsigned char splash[] = {
  #embed "splash.png"
};
C++29direction · not adopted

Direction: pattern matching would retire the overloaded visitor idiom itself — the last big hand idiom with no language spelling.

C++26 per the final working draft; C++29 rows are proposals and direction, not adopted features.