However, the assignment operator survived optimization and got exported from a DLL.
而赋值运算符在优化之后还存活并从DLL中导出。
Well, the assignment operator makes a copy of the thing on the right and puts it in the thing on the left.
赋值操作符把右边的东西,复制到左边。
The assignment operator is applied on a initialized object, but this is not the case in the copy constructor.
赋值运算符是应用于一个初始化的对象,但这并不是拷贝构造函数的情况下。
An assignment operator was not accessible in a base class and was therefore not generated for a derived class.
基类中的赋值运算符不可访问,因此无法为派生类生成赋值运算符。
When a binary operator is overloaded, the corresponding assignment operator, if any, is also implicitly overloaded.
重载二元运算符时,也会隐式重载相应的赋值运算符(如果有)。
If a class defines a copy constructor, acopy assignment operator, or a destructor, then it should define all three.
假定一个类界讲了拷贝机闭函数、赋值操纵符、析构函数中的一个,那么一样平常需供齐数界讲那仨函数。
We'll learn more about operator overloading in the next chapter, but in this chapter we cover the assignment operator.
在下一章我们将进一步学习操作符重载,本章中我们先介绍赋值操作符。
When I return by value from an assignment operator, firstly what is the mechanism and basis of calling the copy constructor?
当我返回值赋值操作符,首先是调用复制构造函数为基础的机制?
As the construction function has three kinds of different conditions, assignment operator overriding must be given attention.
构造函数有三种情况,在重载赋值运算符时一定要分清楚。
The goal here is to avoid accidentally using the single-equals assignment operator instead of the double-equals comparison operator
目标在于避免意外地使用单等号赋值运算符而非双等号比较运算符
On all compound assignment operators, overloading the binary operator implicitly overloads the equivalent compound assignment.
在所有复合指派运算子上,多载二元运算子即隐含多载对等的复合指派。
Put the functionality you need in separate functions called by the destructor and the copy constructor and the assignment operator.
放在单独的功能调用析构函数和拷贝构造函数和赋值运算符你所需要的功能。
However, you can define implicit conversion operators for a type, which enable you to use the assignment operator with those types.
不过,可为类型定义隐式转换运算符,这样就可以对这些类型使用赋值运算符。
This assignment operator implicitly performs widening but not narrowing conversions if the compilation environment enforces strict semantics.
如果编译环境强制使用严格的语义,则此赋值运算符将隐式地执行扩大转换而不是收缩转换。
To manage a class with pointer members, we must define all three copy-control members: the copy constructor, assignment operator, and the destructor.
为了管理具有指针成员的类,必须定义三个复制控制成员:复制构造函数、赋值操作符和析构函数。
Each class whose instance will go into the container must implement at least the copy constructor it is good to implement also the assignment operator.
每个类(其实例要在容器内使用)必须至少实现拷贝构造函数(实现赋值运算符,也是好习惯)。
This section discusses modeling an assignment operator for a C++ class. To generate this assignment operator for a C++ class named Class1, perform these steps
这部分讨论的是为 C++类建模一个赋值操作符。
To resolve C2299, do not make the copy constructor or assignment operator a template function, but rather a non-template function that takes a class type.
若要解决C2299,请不要使复制构造函数或赋值运算符成为模板函数,而使其成为采用类类型的非模板函数。
Now, try using a copy construction and operator assignment for class a, declared in Listing 15.
现在,尝试为类a使用一个复制结构和运算符赋值,在清单15中声明该类。
Variables are dynamically typed on assignment, so there is no need to pre-declare variables or use the new operator.
变量是在赋值时动态键入的,因此不需要预先声明变量或者使用new运算符。
Unlike strings, lists are mutable. When the bracket operator appears on the left side of an assignment, it identifies the element of the list that will be assigned.
和字符串不同的是,列表是可以修改的。方括号运算符放到一个赋值语句的等号左侧的时候,就会把对应位置的列表元素重新赋值。
It is tempting to use the operator on the left side of an assignment, with the intention of changing a character in a string. For example.
大家总是有可能想试试把方括号在赋值表达式的等号左侧,试图去更改字符串中的某一个字符。比如。
It is tempting to use the operator on the left side of an assignment, with the intention of changing a character in a string. For example.
大家总是有可能想试试把方括号在赋值表达式的等号左侧,试图去更改字符串中的某一个字符。比如。
应用推荐