Movatterモバイル変換


[0]ホーム

URL:


cppreference.com
Namespaces
Variants
    Actions

      Punctuation

      From cppreference.com
      <cpp‎ |language
       
       
      C++ language
      General topics
      Flow control
      Conditional execution statements
      Iteration statements (loops)
      Jump statements
      Functions
      Function declaration
      Lambda function expression
      inline specifier
      Dynamic exception specifications(until C++17*)
      noexcept specifier(C++11)
      Exceptions
      Namespaces
      Types
      Specifiers
      constexpr(C++11)
      consteval(C++20)
      constinit(C++20)
      Storage duration specifiers
      Initialization
      Expressions
      Alternative representations
      Literals
      Boolean -Integer -Floating-point
      Character -String -nullptr(C++11)
      User-defined(C++11)
      Utilities
      Attributes(C++11)
      Types
      typedef declaration
      Type alias declaration(C++11)
      Casts
      Memory allocation
      Classes
      Class-specific function properties
      Special member functions
      Templates
      Miscellaneous
       
       

      These are the punctuation symbols in C++. The meaning of each symbol is detailed in the linked pages.

      Contents

      [edit]Preprocessing operators

      Preprocessing operators are recognized bypreprocessors.

      [edit]# (including%:)

      [edit]##(including%:%:)

      [edit]Single-character operators and punctuators

      [edit]{ and} (including<% and%>)

      (since C++11)
      (since C++20)

      [edit][ and] (including<: and:>)

      (since C++11)
      (since C++17)
      (since C++26)

      [edit]( and)

      (since C++11)
      (since C++11)
      (since C++17)
      (since C++20)
      (since C++11)
      • In ahandler, delimit the parameter declaration.
      • In afunction-like macro definition, delimit the macro parameters.
      • In afunction-like macro invocation, delimit the macro arguments or prevent commas from being interpreted as argument separators.
      • Part of adefined,__has_include(since C++17),__has_cpp_attribute(since C++20) preprocessing operator.
      • In astatic_assert declaration, delimit the operands.
      • Delimit the operand of the following specifiers:
      (since C++20)
      • In anattribute, delimit the attribute arguments.
      (since C++11)
      (since C++14)
      (since C++17)
      • Part of__VA_OPT__ replacement in a variadic macro definition.
      (since C++20)

      [edit];

      • Indicate the end of
      (since C++20)

      [edit]:

      (since C++11)
      (since C++17)
      (since C++20)

      [edit]?

      [edit].

      (since C++20)

      [edit]~ (includingcompl)

      [edit]! (includingnot)

      (since C++23)

      [edit]+

      [edit]-

      [edit]*

      • Part of*this in alambda capture list, to capture the current object by copy.
      (since C++17)

      [edit]/

      [edit]%

      [edit]^ (includingxor)

      [edit]& (includingbitand)

      (since C++11)

      [edit]| (includingbitor)

      [edit]=

      (since C++11)
      (since C++20)

      [edit]<

      (since C++20)
      (since C++17)
      (since C++20)

      [edit]>

      (since C++20)
      (since C++17)
      (since C++20)

      [edit],

      (since C++11)
      (since C++17)
      (since C++23)
      (since C++11)

      [edit]Multi-character operators and punctuators

      [edit]...

      • In theparameter list of a function declaratoror lambda expression(since C++11)or user-defined deduction guide(since C++17), signify avariadic function.
      • In ahandler, signify catch-all handler.
      (since C++11)
      (since C++26)

      [edit]::

      • Scope resolution operator in
      (since C++11)
      (since C++17)

      [edit].*

      [edit]->

      (since C++11)
      (since C++17)
      (since C++20)

      [edit]->*

      [edit]+=

      [edit]-=

      [edit]*=

      [edit]/=

      [edit]%=

      [edit]^= (includingxor_eq)

      [edit]&= (includingand_eq)

      [edit]|= (includingor_eq)

      [edit]==

      [edit]!= (includingnot_eq)

      [edit]<=

      [edit]>=

      <=>

      (since C++20)

      [edit]&& (includingand)

      (since C++11)

      [edit]|| (includingor)

      [edit]<<

      [edit]>>

      [edit]<<=

      [edit]>>=

      [edit]++

      [edit]--

      [edit]References

      • C++23 standard (ISO/IEC 14882:2024):
      • 5.12 Operators and punctuators [lex.operators]
      • C++20 standard (ISO/IEC 14882:2020):
      • 5.12 Operators and punctuators [lex.operators]
      • C++17 standard (ISO/IEC 14882:2017):
      • 5.12 Operators and punctuators [lex.operators]
      • C++14 standard (ISO/IEC 14882:2014):
      • 2.13 Operators and punctuators [lex.operators]
      • C++11 standard (ISO/IEC 14882:2011):
      • 2.13 Operators and punctuators [lex.operators]
      • C++03 standard (ISO/IEC 14882:2003):
      • 2.12 Operators and punctuators [lex.operators]
      • C++98 standard (ISO/IEC 14882:1998):
      • 2.12 Operators and punctuators [lex.operators]

      [edit]See also

      Alternative representations alternative spellings for certain operators[edit]
      C documentation forPunctuation
      Retrieved from "https://en.cppreference.com/mwiki/index.php?title=cpp/language/punctuators&oldid=173967"

      [8]ページ先頭

      ©2009-2025 Movatter.jp