正在加载图片...
To overload the equality operator(=) To overload an operator on a custom class requires creating a method on the class with the correct signature The method must be named operator x"where x is the name or symbol of the operator being overloaded Unary operators have one parameter, and binary operators have two parameters In each case, one parameter must be the same type as the class or struct that declares the operator.To overload the equality operator (==) • To overload an operator on a custom class requires creating a method on the class with the correct signature. • The method must be named "operator X" where X is the name or symbol of the operator being overloaded. • Unary operators have one parameter, and binary operators have two parameters. • In each case, one parameter must be the same type as the class or struct that declares the operator
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有