Provide primitive algorithms that operate on single elements.
More...
Detailed Description
- Outline
-
-
- Purpose:
- Provide primitive algorithms that operate on single elements.
-
- Classes:
-
- See also:
- Component 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
-------------------------------------------- -----------------------------
bsl::is_trivially_default_constructible "TYPE has the trivial default
constructor trait", or
"TYPE has a trivial default
constructor"
bsl::is_trivially_copyable "TYPE has the bit-wise
copyable trait", or
"TYPE is bit-wise copyable"
(implies that it has a
trivial destructor too)
bslmf::IsBitwiseMoveable "TYPE has the bit-wise
moveable trait", or
"TYPE is bit-wise moveable"
bslma::UsesBslmaAllocator "the 'TYPE' constructor takes
an allocator argument", or
"'TYPE' supports 'bslma'
allocators"
bslmf::UsesAllocatorArgT "the 'TYPE' constructor takes
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.
-
- Usage:
- This component is for use primarily by the
bslstl
package. Other clients should use the STL algorithms provided in <algorithm>
and <memory>
.
Typedef Documentation