|
stlab 2.3.0
Modern, modular C++ algorithms, data structures, and concurrency primitives
|
Type utilities (move, copy, static_max, etc.). More...
#include <stlab/config.hpp>#include <array>#include <cstddef>#include <initializer_list>#include <type_traits>#include <utility>Go to the source code of this file.
Functions | |
| template<bool P, class T> | |
| constexpr auto | stlab::move_if (T &&t) noexcept -> detail::move_if_helper_t< P, T > |
| If P is true, casts t to an rvalue; otherwise keeps an lvalue reference. | |
| template<class F, class... Args> | |
| void | stlab::for_each_argument (F &&f, Args &&... args) |
| Invokes f(arg0), f(arg1), … f(argN). | |
| template<typename T> | |
| constexpr auto | stlab::copy (T &&value) noexcept(noexcept(std::decay_t< T >{static_cast< T && >(value)})) -> std::decay_t< T > |
| Returns a copy of the argument. Used to pass an lvalue to a function taking an rvalue, or to copy a type with an explicit copy constructor. | |
| template<class T> | |
| constexpr auto | stlab::move (T &&t) noexcept -> std::remove_reference_t< T > && |
| A standard move implementation but with a compile-time check for const types. | |
Type utilities (move, copy, static_max, etc.).