4#ifndef TETL_FUNCTIONAL_REFERENCE_WRAPPER_HPP
5#define TETL_FUNCTIONAL_REFERENCE_WRAPPER_HPP
7#include <etl/_functional/invoke.hpp>
8#include <etl/_memory/addressof.hpp>
9#include <etl/_type_traits/declval.hpp>
10#include <etl/_type_traits/enable_if.hpp>
11#include <etl/_type_traits/invoke_result.hpp>
12#include <etl/_type_traits/is_same.hpp>
13#include <etl/_type_traits/remove_cvref.hpp>
14#include <etl/_utility/forward.hpp>
20constexpr auto FUN(T& t)
noexcept -> T&
26void FUN(T&&) =
delete;
59 =
decltype(detail::FUN<T>(declval<U>()), enable_if_t<!is_same_v<
reference_wrapper, remove_cvref_t<U>>>())
62 : _ptr(addressof(detail::FUN<T>(
etl::forward<U>(u))))
91 template <
typename... Args>
93 -> invoke_result_t<T&, Args...>
95 return invoke(
get(),
etl::forward<Args>(args)...);
138 return cref(t.get());
Definition adjacent_find.hpp:9
constexpr auto cref(T const &t) noexcept -> reference_wrapper< T const >
Function templates ref and cref are helper functions that generate an object of type reference_wrappe...
Definition reference_wrapper.hpp:130
constexpr auto ref(T &t) noexcept -> reference_wrapper< T >
Function templates ref and cref are helper functions that generate an object of type reference_wrappe...
Definition reference_wrapper.hpp:111
reference_wrapper(T &) -> reference_wrapper< T >
constexpr auto cref(reference_wrapper< T > t) noexcept -> reference_wrapper< T const >
Definition reference_wrapper.hpp:136
constexpr auto ref(reference_wrapper< T > t) noexcept -> reference_wrapper< T >
Function templates ref and cref are helper functions that generate an object of type reference_wrappe...
Definition reference_wrapper.hpp:120
void cref(T const &&)=delete
reference_wrapper is a class template that wraps a reference in a copyable, assignable object....
Definition reference_wrapper.hpp:41
constexpr auto operator=(reference_wrapper const &x) noexcept -> reference_wrapper &=default
Copy assignment operator. Drops the current reference and stores a reference to other....
constexpr reference_wrapper(reference_wrapper const &x) noexcept=default
Constructs a new reference wrapper. Copy constructor. Stores a reference to other....
constexpr operator type &() const noexcept
Returns the stored reference.
Definition reference_wrapper.hpp:75
constexpr reference_wrapper(U &&u) noexcept(noexcept(detail::FUN< T >(etl::forward< U >(u))))
Constructs a new reference wrapper. Converts x to T& as if by T& t = etl::forward(x);,...
Definition reference_wrapper.hpp:61
constexpr auto get() const noexcept -> type &
Returns the stored reference.
Definition reference_wrapper.hpp:81
constexpr auto operator()(Args &&... args) const noexcept(noexcept(invoke(get(), etl::forward< Args >(args)...))) -> invoke_result_t< T &, Args... >
Calls the Callable object, reference to which is stored. This function is available only if the store...
Definition reference_wrapper.hpp:92