Rvalue assignment: dcpp::shared_device::operator=
Rvalue assignment operator= of dcpp::shared_device: move underlying device
of temporary object to current object.
Calling Sig:
dcpp::shared_device & operator=(const self_type && other__);
device2 = <temporary object expression>;
Rvalue assignment operator= of dcpp::shared_device will move the underlying
device of the <temporary object expression>
to device2, the reference counter that the <temporary object expression>
stands for will be set to zero, and the reference counter of device2 will
be set to one.
-
Current object device2 will reference to the underlying device that
<temporary object expression>
holds;
-
The other object <temporary object expression>
will be dereferenced from the underlying device;
-
The reference counter of all objects that holds what other object
<temporary object expression>
holds before will be set to zero;
-
The reference counter of old device that the current object device2
held will be decreased by one;
-
The reference counter of current object device2 is set to one;
-
If the underlying device of <temporary object
expression> is invalid or its reference counter is zero,
device2 will be dereferenced from its previous underlying device, and
its reference counter is set to zero; in such case, if device2 is the
only object that holds its underlying device, the underlying device
will be destroyed and device2's reference counter is set to zero.
Rvalue assignment is experimental, it is not allowed
at the first time,
Then it is added, removed, and added again.
Rvalue assignment should be used carefuly in a video driver that does not
well support multithreading programming.
I might remove it again
if a more well reason is found in the future.
Up
Duckcpp
cppfx.xyz