9#ifndef INCLUDE_GUARD_ARENE_BASE_ARENE_BASE_UTILITY_FORWARD_LIKE_HPP_
10#define INCLUDE_GUARD_ARENE_BASE_ARENE_BASE_UTILITY_FORWARD_LIKE_HPP_
17#include "arene/base/stdlib_choice/is_const.hpp"
18#include "arene/base/stdlib_choice/is_lvalue_reference.hpp"
19#include "arene/base/stdlib_choice/remove_reference.hpp"
26namespace forward_like_detail {
30template <
typename From>
44 std::is_const<std::remove_reference_t<From>>::value,
67 template <
typename To>
68 ARENE_NODISCARD constexpr auto operator()(To&& val)
const noexcept -> forward_like_result_t<To> {
69 return static_cast<forward_like_result_t<To>
>(val);
94template <
typename From>
95extern constexpr auto forward_like = forward_like_detail::forward_like<From>{};
static constexpr value_type value
Definition integral_constant.hpp:34
Definition accumulate.hpp:37
typename static_if< B >::template then_else< T, F > conditional_t
lazily select between two types based on a boolean condition
Definition conditional.hpp:28
constexpr auto forward_like
A backport of C++23's std::forward_like, which allows forwarding a type with the same reference and c...
Definition accumulate.hpp:36
typename remove_reference< T >::type remove_reference_t
An alias for T, but with top-level reference qualifiers removed.
Definition remove_reference.hpp:47
#define ARENE_NODISCARD
An alias for [[nodiscard]] , or a no-op if the attribute is not supported.
Definition nodiscard.hpp:26