6#ifndef SL_UTILITY_FUNCTIONAL_UTILITY_HPP
7#define SL_UTILITY_FUNCTIONAL_UTILITY_HPP
33 inline constexpr auto as = envelop<Transform>(
38 return static_cast<To
>(std::forward<From>(arg));
45 []<
class T>(T&& arg)
constexpr noexcept(
noexcept(*std::declval<T>())) ->
decltype(
auto)
49 return *std::forward<T>(arg);
56 inline constexpr auto addressof = envelop<Transform>(
57 [](
auto& arg)
constexpr noexcept
59 static_assert(
requires { { std::addressof(arg) } ->
concepts::pointer; },
"Argument is not usable for std::addressof.");
61 return std::addressof(arg);
Determines whether a type can be used in unary operator * expressions.
Definition: operators.hpp:725
Checks whether a type is explicit convertible to another.
Definition: stl_extensions.hpp:164
Checks whether a type is explicit convertible to another and does not throw.
Definition: stl_extensions.hpp:177
Checks whether the T denotes a (possibly cv-qualified) pointer type.
Definition: stl_extensions.hpp:35
constexpr auto dereference
Functional object which dereferences the given argument and returns the result.
Definition: Utility.hpp:44
constexpr auto as
Functional object which converts the given argument to the target type via static_cast.
Definition: Utility.hpp:33
constexpr auto addressof
Functional object which returns the address of the given argument.
Definition: Utility.hpp:56
Definition: Utility.hpp:19