17#ifndef WPIUTIL_WPI_STLFORWARDCOMPAT_H
18#define WPIUTIL_WPI_STLFORWARDCOMPAT_H
32 using type = std::remove_cv_t<std::remove_reference_t<T>>;
45template <
typename T,
typename Function>
47 -> std::optional<
decltype(F(*O))> {
55template <
typename T,
typename Function>
57 -> std::optional<
decltype(F(*std::move(O)))> {
59 return F(*std::move(O));
65template <
typename Enum>
66[[nodiscard]]
constexpr std::underlying_type_t<Enum>
to_underlying(Enum E) {
67 return static_cast<std::underlying_type_t<Enum>
>(E);
typename std::remove_cv< remove_reference_t< T > >::type remove_cvref_t
Definition base.h:313
Definition ntcore_cpp.h:26
auto transformOptional(const std::optional< T > &O, const Function &F) -> std::optional< decltype(F(*O))>
Definition STLForwardCompat.h:46
constexpr std::underlying_type_t< Enum > to_underlying(Enum E)
Returns underlying integer value of an enum.
Definition STLForwardCompat.h:66
Definition STLForwardCompat.h:31
std::remove_cv_t< std::remove_reference_t< T > > type
Definition STLForwardCompat.h:32