🛠️ Steven Gong

Search

SearchSearch

Feb 24, 2025, 1 min read

Type Traits (C++)

Allows us to query or modify properties of types at compile-time. Introduced in C++11.

Resources

  • https://en.cppreference.com/w/cpp/header/type_traits

Commonly used

  • std::enable_if
  • std::conditional
  • std::is_same
  • `std::remove_const
    • Removes const qualifier from T
    • difference with const_cast? That does it on a particular variable instance, as opposed to making a modification on a type
  • std::add_pointer<T>

Lots of modern C++ is around this.

Graph View

Backlinks

  • C++
  • Type Inference

Created with Quartz, © 2025

  • Blog
  • LinkedIn
  • Twitter
  • GitHub