Movatterモバイル変換


[0]ホーム

URL:


cppreference.com
Namespaces
Variants
    Actions

      typeof operators(since C23)

      From cppreference.com
      <c‎ |language
       
       
       
       

      Determines the type of an object.

      Contents

      [edit]Syntax

      typeof(type) (1)
      typeof(expression) (2)
      typeof_unqual(type) (3)
      typeof_unqual(expression) (4)

      [edit]Explanation

      1) produces the type-name with any nested typeof-specifier evaluated
      2) yields the type-name representing the type of its operand. No implicit conversions are applied toexpression.
      3,4) the same as(1) and(2) respectively but remove qualifiers

      [edit]Notes

      typeof andtypeof_unqual are collectively called thetypeof operators. Thetypeof operators cannot be applied to bit-field members. If the type of the operand is a variably modified type, the operand is evaluated; otherwise, the operand is not evaluated. The result of thetypeof_unqual operator is the non-atomic unqualified type that would result from thetypeof operator. Thetypeof operator preserves all qualifiers.

      [edit]Example

      This section is incomplete
      Reason: no example

      [edit]References

      • C23 standard (ISO/IEC 9899:2024):
      • 6.7.2.5 The typeof specifiers (p: 115-118)

      [edit]See also

      C++ documentation fordecltype
      Retrieved from "https://en.cppreference.com/mwiki/index.php?title=c/language/typeof&oldid=159494"

      [8]ページ先頭

      ©2009-2025 Movatter.jp