This documentation is archived and is not being maintained.

common_type Class

Makes an instance of the common type of two types.

template<class Ty0, Ty1>
    struct common_type;

Parameter

Description

Ty0

The type to evaluate.

Ty1

The type to evaluate.

An instance of this type modifier holds a modified-type that is:

  • Ty, if the template parameter pack has exactly one argument.

  • the type of the expression decltype(true ? Tgen() : Ugen()), where Tgen() is an imaginary function returning a value of type T&& and Ugen() is an imaginary function returning a value of type U&&, if the template parameter pack has exactly two arguments T and U.

Header: <type_traits>

Namespace: std

Show: