Type that tracks whether it has been copied into, moved into, or moved from.

Synopsis

Declared in <bsltf_copymovetracker.h>

class CopyMoveTracker;

Member Functions

Name

Description

CopyMoveTracker [constructor]

Constructors

operator=

Assignment operators

copyMoveState

Return this object's state.

hasUnknownCopyMoveState

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

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

Return true if this object's state includes the e_COPIED_INTO bit but not e_UNKNOWN. This attribute is true if either isCopiedConstInto() or isCopiedNonconstInto() is true.

isCopiedNonconstInto

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

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

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

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.

resetCopyMoveState

Set this object to the e_NOT_COPIED_OR_MOVE state.

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.

Friends

Name

Description

BloombergLP::bsltf::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.

BloombergLP::bsltf::copyMoveState

Return the state of the specified tracker. This function is an ADL customization point used by CopyMoveState::get(obj).

BloombergLP::bsltf::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.

BloombergLP::bsltf::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.

Created with MrDocs