#include <bsltf_copymovetracker.h>
Type that tracks whether it has been copied into, moved into, or moved from.
See bsltf_copymovetracker
◆ CopyMoveTracker() [1/5]
bsltf::CopyMoveTracker::CopyMoveTracker |
( |
| ) |
|
|
inline |
◆ CopyMoveTracker() [2/5]
bsltf::CopyMoveTracker::CopyMoveTracker |
( |
const CopyMoveTracker & |
original | ) |
|
|
inline |
◆ CopyMoveTracker() [3/5]
◆ CopyMoveTracker() [4/5]
Create object an object in the e_MOVED_INTO
state and set the state of original
to the bitwise OR of its inititial state and e_MOVED_FROM
.
◆ CopyMoveTracker() [5/5]
Create object an object in the e_MOVED_INTO
state and set the state of original
to the bitwise OR of its initial state and e_MOVED_FROM
. This constructor will not participate in overload resolution unless a DERIVED
is derived from CopyMoveTracker
; in C++03, therefore, this constructor will simulate automatic derived-to-base conversion of rvalue references.
◆ ~CopyMoveTracker()
bsltf::CopyMoveTracker::~CopyMoveTracker |
( |
| ) |
|
|
default |
◆ copyMoveState()
◆ hasUnknownCopyMoveState()
bool bsltf::CopyMoveTracker::hasUnknownCopyMoveState |
( |
| ) |
const |
|
inline |
Return true
if this object's state includes the e_UNKNOWN
bit. This attribute can be true
only if setCopyMoveState
was called with an enumerator value that includes the e_UNKNOWN
bit.
◆ isCopiedConstInto()
bool bsltf::CopyMoveTracker::isCopiedConstInto |
( |
| ) |
const |
|
inline |
Return true
if this object's state includes the e_COPIED_CONST_INTO
bits but not e_UNKNOWN
. This attribute is true
if this object was copy constructed or copy assigned from a const
lvalue (or, in C++03, from a prvalue).
◆ isCopiedInto()
bool bsltf::CopyMoveTracker::isCopiedInto |
( |
| ) |
const |
|
inline |
◆ isCopiedNonconstInto()
bool bsltf::CopyMoveTracker::isCopiedNonconstInto |
( |
| ) |
const |
|
inline |
Return true
if this object's state includes the e_COPIED_NONCONST_INTO
bits but not e_UNKNOWN
. This attribute is true
if this object was copy constructed or copy assigned from a non-const
lvalue.
◆ isMovedFrom()
bool bsltf::CopyMoveTracker::isMovedFrom |
( |
| ) |
const |
|
inline |
Return true
if this object's state includes the e_MOVED_FROM
bit but not e_UNKNOWN
. This attribute is true
if this object was the argument of the move constructor or the rhs of the move assignment operator and was not subsequently modified.
◆ isMovedInto()
bool bsltf::CopyMoveTracker::isMovedInto |
( |
| ) |
const |
|
inline |
Return true
if this object's state includes the e_MOVED_INTO
bit but not e_UNKNOWN
. This attribute is true
if this object was move constructed or was the lhs the of move assignment operator.
◆ isOriginal()
bool bsltf::CopyMoveTracker::isOriginal |
( |
| ) |
const |
|
inline |
Return true
if this object is not in a copied-into, moved-into, or unknown state. This attribute is true
if this object was default constructed or reset and not subsequently assigned to.
◆ operator=() [1/4]
Set this object to the e_MOVED_INTO
state and return a modifiable reference to this object. Set the state of rhs
to the bitwise OR of its initial state and e_MOVED_FROM
.
◆ operator=() [2/4]
Set this object to the e_MOVED_INTO
state and return a modifiable reference to this object. Set the state of rhs
to the bitwise OR of its initial state and e_MOVED_FROM
. This operator will not participate in overload resolution unless a DERIVED
is derived from CopyMoveTracker
; in C++03, therefore, this operator will simulate automatic derived-to-base conversion of rvalue references.
◆ operator=() [3/4]
Set this object to the e_COPIED_CONST_INTO
state and return a modifiable reference to this object.
◆ operator=() [4/4]
Set this object to the e_COPIED_NONCONST_INTO
state and return a modifiable reference to this object.
◆ resetCopyMoveState()
void bsltf::CopyMoveTracker::resetCopyMoveState |
( |
| ) |
|
|
inline |
◆ setCopyMoveState()
Set this object to the specified state
, which might be the bitwise OR of e_MOVED_FROM
and one of the other enumerator values. The behavior is undefined unless CopyMoveState::isValid(state)
is true
.
◆ swapCopyMoveStates()
Set the state of both the specified this
and b
objects to the bitwise OR of e_MOVED_INTO
and e_MOVED_FROM
.
◆ copyMoveState
Return the state of the specified tracker
. This function is an ADL customization point used by CopyMoveState::get(obj)
.
◆ operator!=
Return false
; the copy/move state is not a salient attribute, so all CopyMoveTracker
objects compare equal. Note that this operator is called implicitly if a client class defines a defaulted comparison operator (C++20), but will not be selected by overload resolution for a derived class having no comparison operator.
◆ operator==
Return true
; the copy/move state is not a salient attribute, so all CopyMoveTracker
objects compare equal. Note that this operator is called implicitly if a client class defines a defaulted comparison operator (C++20), but will not be selected by overload resolution for a derived class having no comparison operator.
◆ setCopyMoveState
Set the object at the specified tracker
address to the specified state
. This function is an ADL customization point used by CopyMoveState::set(obj, state)
. The behavior is undefined unless CopyMoveState::isValid(state)
is true
.
The documentation for this class was generated from the following file: