Outline
Purpose
Provide primitive algorithms that operate on single elements.
Classes
- See also
- bslalg_constructorproxy
Description
This component provides primitive algorithms that operate on single elements with a uniform interface but select a different implementation according to the various type traits possessed by the underlying type. Such primitives are exceptionally useful for implementing generic components such as containers. There are six families of algorithms, each with a collection of overloads:
Algorithm Forwards to (depending on traits)
---------------- ------------------------------------------------
defaultConstruct Default constructor, with or without allocator
copyConstruct Copy constructor, with or without allocator,
or bitwise copy if appropriate
moveConstruct Move constructor, with or without allocator,
or bitwise copy if appropriate. In C++03 mode,
behavior is the same as 'copyConstruct'.
destructiveMove Move construction followed by destruction of the
original, with or without allocator,
or bitwise copy if appropriate
construct In-place construction (using variadic template
arguments, simulated by overloads), with
or without allocator
swap Three way assignment, or bitwise swap
The traits under consideration by this component are:
Trait Description
-------------------------------------------- -----------------------------
constructor trait", or
"TYPE has a trivial default
constructor"
copyable trait", or
"TYPE is bit-wise copyable"
(implies that it has a
trivial destructor too)
moveable trait", or
"TYPE is bit-wise moveable"
an allocator argument", or
"'TYPE' supports 'bslma'
allocators"
an allocator argument", and
optionally passes allocators
as the first two arguments to
each constructor, where the
tag type 'allocator_arg_t' is
first, and the allocator type
is second.
Definition bslmf_istriviallydefaultconstructible.h:293
Definition bslma_usesbslmaallocator.h:343
Definition bslmf_isbitwisecopyable.h:298
Definition bslmf_isbitwisemoveable.h:718
Definition bslmf_usesallocatorargt.h:100
Usage
This component is for use primarily by the bslstl
package. Other clients should use the STL algorithms provided in <algorithm>
and <memory>
.
◆ bslalg_ScalarPrimitives