What is 'deducing this' in C++23, and how does it simplify the CRTP pattern?

Last updated 21 June 2026

  • "Deducing this" (explicit object parameter) lets a member take its object as an explicit first parameter, e.g. this auto&& self. The object's actual type and cv/ref qualifiers are deduced, so one template replaces const/non-const and lvalue/rvalue overloads.

  • For CRTP (a base templated on its derived class), the base becomes a plain class. self already has the derived type, so the Derived template parameter and static_cast<Derived&>(*this) disappear.

  • Caveat: such members cannot be static or virtual, and the implicit this pointer is not used inside them.

  • https://gist.github.com/MangaD/a5c5d430f8ef0d791b5a4f6664da1b95
  • https://devblogs.microsoft.com/cppblog/cpp23-deducing-this/
  • https://www.geeksforgeeks.org/cpp/cpp-23-standard/
  • https://news.ycombinator.com/item?id=36663947
  • https://github.com/unrays/exotic-crtp
  • https://stackoverflow.com/questions/78201757/crtp-and-alternative
All C++ interview questions