A literal type is a type whose objects can be used in constant expressions. It is different from fundamental literals such that literals are constexpr values that put into the source code but literal type is the type of the value which can be used as constexpr value.

All literals have literal type but not all values of type literal type are literals.

For simplicity, literal types can include followings:

  1. Scalar type (types storing single value such as fundamental types, pointers, literals)
  2. References
  3. classes with constexpr constructors
  4. Most aggregates (structs, array of constexpr values etc.)

References

  1. https://www.learncpp.com/cpp-tutorial/constexpr-aggregates-and-classes/
  2. https://en.cppreference.com/w/cpp/named_req/LiteralType