在哪里可以找到所有运算符重载的函数签名列表?
Where can one find a list of the function signatures for all operator overloads?
维基百科:C 和 C++ 中的运算符。
Wikipedia: Operators in C and C++.
ISO/IEC 14882:2003 §13.5,重载运算符
如果您没有文档的副本,它不如维基百科列表那么有用,但它的优点是具有权威性。
您还可以查阅C++0x的最新草案,N3126,§13.5,重载运算符。
ISO/IEC 14882:2003 §13.5, Overloaded Operators
It's not quite as useful as the Wikipedia list if you don't have a copy of the document, but it has the benefit of being authoritative.
You can also consult the latest draft of C++0x, N3126, §13.5, Overloaded Operators.
您可以在 cppreference 上找到它们,按操作员笼子划分:
a=b
a+=b
a-=b
a*=b
a/=b
a%=b
a& =b
a|=b
a^=b
a<<=b
a> >=b
+ +a
--a
a++
a--
+a
-a
a+b
ab
a*b
a/b
a%b
~a
a&b
a|b
a^b
a< code>, a>>b
a>>b
a||b
a&&b
!a
a==b
a!=b
a、a>b、a<=b、a>=b、a<=> ;b(C++20)
a>b
a<=b
a>=b
a<=> ;b
a[b]
*a
&a
a->b
a->*b
a.*b
a(...)
a,b
a?b:c
我建议检查 中的规范实现运算符重载页面。
You can find them on cppreference, divided by operator cagetory:
a&=b
a>>=b
++a
a-b
a<<b
a<b
a<=>b
a.b
I suggest to check the Canonical implementations in the operator overloading page.
书中:Bruce Eckel 所著的《Thinking in C++,第 2 版,第 1 卷》
您可以在线阅读。例如,您要查找的章节(第 12 章)可以在此处找到。
In the book: "Thinking in C++, 2nd ed. Volume 1" by Bruce Eckel
You can read it online. The chapter you are looking for (chapter 12), can be found here, for example.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
暂无简介
文章 0 评论 0
接受
发布评论
评论(4)
维基百科:C 和 C++ 中的运算符。
Wikipedia: Operators in C and C++.
ISO/IEC 14882:2003 §13.5,重载运算符
如果您没有文档的副本,它不如维基百科列表那么有用,但它的优点是具有权威性。
您还可以查阅C++0x的最新草案,N3126,§13.5,重载运算符。
ISO/IEC 14882:2003 §13.5, Overloaded Operators
It's not quite as useful as the Wikipedia list if you don't have a copy of the document, but it has the benefit of being authoritative.
You can also consult the latest draft of C++0x, N3126, §13.5, Overloaded Operators.
您可以在 cppreference 上找到它们,按操作员笼子划分:
a=b
、a+=b
、a-=b
、a*=b
、a/=b
、a%=b
、a& =b
、a|=b
、a^=b
、a<<=b
、a> >=b
+ +a
、--a
、a++
、a--
+a
、-a
、a+b
、ab
、a*b
、a/b
、a%b
、~a
、a&b
、a|b
、a^b
、a< code>,
a>>b
a||b
,a&&b
,!a
a==b
、a!=b
、a、
a>b
、a<=b
、a>=b
、a<=> ;b
(C++20)a[b]
、*a
、&a
、a->b
、ab
,a->*b
,a.*b
a(...)
、a,b
、a?b:c
我建议检查 中的规范实现运算符重载页面。
You can find them on cppreference, divided by operator cagetory:
a=b
,a+=b
,a-=b
,a*=b
,a/=b
,a%=b
,a&=b
,a|=b
,a^=b
,a<<=b
,a>>=b
++a
,--a
,a++
,a--
+a
,-a
,a+b
,a-b
,a*b
,a/b
,a%b
,~a
,a&b
,a|b
,a^b
,a<<b
,a>>b
a||b
,a&&b
,!a
a==b
,a!=b
,a<b
,a>b
,a<=b
,a>=b
,a<=>b
(C++20)a[b]
,*a
,&a
,a->b
,a.b
,a->*b
,a.*b
a(...)
,a,b
,a?b:c
I suggest to check the Canonical implementations in the operator overloading page.
书中:Bruce Eckel 所著的《Thinking in C++,第 2 版,第 1 卷》
您可以在线阅读。例如,您要查找的章节(第 12 章)可以在此处找到。
In the book: "Thinking in C++, 2nd ed. Volume 1" by Bruce Eckel
You can read it online. The chapter you are looking for (chapter 12), can be found here, for example.