gpt4 book ai didi

C++ 官方运算符名称/关键字

转载 作者:IT老高 更新时间:2023-10-28 12:37:54 24 4
gpt4 key购买 nike

祝大家节日快乐。

我一直在研究 C++ 预处理器序列(使用 boost)来帮助我生成基于​​运算符的仿函数。到目前为止,我已经完成了源代码,但是我很难找到识别这些仿函数的最合适的关键字。

更具体地说,在查看 C++0x 草案后,我没有为以下运算符找到最合适的(唯一)名称:

  • -> 和 .在草案中都称为:类成员运算符
  • ->* 和 .* 都被称为:指向成员运算符的指针

你认为你能帮我更好地命名它们吗?

我使用的引用文献:

  1. C++0x 草案(可在线找到)
  2. "boost/proto/operators.hpp"包含大多数可重载运算符的 header 。
  3. Operators in C and C++来自维基百科,它还提供了以下名称
    • 。结构引用
    • -> 结构解引用
    • ->* 和 .* 成员指针

这是我目前创建的列表。任何其他建议将不胜感激。

 Symbol        Keyword           Description
++ , post_increment , post increment
-- , post_decrement , post decrement
++ , pre_increment , pre increment
-- , pre_decrement , pre decrement
+ , unary_plus , additive promotion
- , unary_minus , additive inversion
! , negate , logical negation
~ , complement , complement
* , indirect , indirection
& , address_of , address of
+ , add , addition
- , subtract , subtraction
* , multiplies , multiplication
/ , divides , division
% , modulus , modulo
== , equal , equality
!= , inequal , inequality
> , greater , greater than
< , less , less than
>= , greater_equal , greater or equal than
<= , less_equal , less or equal than
&& , logical_and , logical and
|| , logical_or , logical or
& , bitwise_and , bitwise and
| , bitwise_or , bitwise inclusive or
^ , bitwise_xor , bitwise exclusive or
<< , left_shift , left shift
>> , right_shift , right shift
+= , add_assign , addition assignment
-= , subtract_assign , subtractions assignment
*= , multiplies_assign , multiplication assignment
/= , divides_assign , division assignment
%= , modulus_assign , modulo assignment
>>= , right_shift_assign , right shift assignment
<<= , left_shift_assign , left shift assignment
&= , bitwise_and_assign , bitwise and assignment
^= , bitwise_or_assign , bitwise exclusive or assignment
|= , bitwise_or_assign , bitwise inclusive or assignment
->* , arrow_indirect , pointer to member
, , comma , comma
= , assign , assignment
[] , subscript , subscription
-> , arrow , class member
. , dot , class member
.* , dot_indirect , pointer to member

最佳答案

试试 this reference .

new、delete、casting,我觉得还有一些操作符和关键字。

关于C++ 官方运算符名称/关键字,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8679089/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com