Template Function beluga::forward_like

Function Documentation

template<class T, class U>
constexpr auto &&beluga::forward_like(U &&value) noexcept

Returns a reference to a value which has similar properties to T&&.

Implementation taken from https://en.cppreference.com/w/cpp/utility/forward_like since this feature is only available starting with C++23.

The program is ill-formed if T&& is not a valid type.

Template Parameters:
  • T – The type from which to take the properties.

  • U – The type of the input value.

Parameters:

value – A value that needs to be forwarded like type T.

Returns:

A reference to value of the determined type.