Skip to content

Search topics & cppreference

Search all study topics, concept maps, and 6,587 C++ and C reference pages.

C++ keyword: typename

Keywords
  • C++17
  • C++20
1 min readView on cppreference
NotebookLM

Usage

  • In the template parameter list of a template declaration, typename can be used as an alternative to class to declare type template parameters and template template parameters(since C++17).
  • Inside a declaration or a definition of a template, typename can be used to declare that a dependent qualified name is a type.
  • typename can be used before a non-dependent qualified type name. It has no effect in this case.
(since C++20)

See also

(since C++20)

Content from this page on cppreference.com, licensed under CC-BY-SA 3.0 and GFDL. Modified: restyled, site navigation removed, code windows added. Offline snapshot of 9 February 2025.