Expand description
In-place constructors.
This module provides a range of helpers such as new::by() and
new::from() for creating constructors. It is preferred style to
use moveit::new; and refer to these helpers with a new:: prefix.
Traits§
- A copy constructible type: a destination-aware
Clone. - A pointer type that may be “emplaced” as a stable address which a
Newmay be used to construct a value with. - A move constructible type: a destination-aware
Clonethat destroys the moved-from value. - An in-place constructor for a particular type.
- A swappable type, which is able to efficiently swap the contents of two of its values.
- An in-place constructor for a particular type, which can potentially fail.
Functions§
- Returns a
Newthat uses the provided closure for constructing aT. - Returns a
Newthat uses the provided closure for construction. - Returns a new
Newthat uses a copy constructor. - Returns a
Newthat simply returns the given value. - Returns a
TryNewthat uses the provided closure for constructing aT. - Returns a
TryNewthat uses the provided closure for construction.