Template Class optional< T & >

Page Contents

Class Documentation

template<class T>
class optional<T&>

Public Functions

inline constexpr optional() noexcept
inline constexpr optional(nullopt_t) noexcept
template<typename U = T>
inline constexpr optional(U &u) noexcept
template<typename U = T>
optional(U&&) = delete
inline constexpr optional(const optional &rhs) noexcept
inline explicit constexpr optional(in_place_t, T &v) noexcept
explicit optional(in_place_t, T&&) = delete
~optional() = default
inline optional &operator=(nullopt_t) noexcept
template<typename U, typename = std::enable_if_t<std::is_same_v<typename std::decay<U>::type, optional<T&>>>>
inline optional &operator=(U &&rhs) noexcept
template<typename U>
auto operator=(U &&rhs) noexcept -> typename std::enable_if<!std::is_same<typename std::decay<U>::type, optional<T&>>::value, optional&>::type = delete
inline void emplace(T &v) noexcept
void emplace(T&&) = delete
inline void swap(optional<T&> &rhs) noexcept
inline constexpr T *operator->() const
inline constexpr T &operator*() const
inline constexpr T &value() const
inline explicit constexpr operator bool() const noexcept
inline constexpr bool has_value() const noexcept
template<class V>
inline constexpr std::decay<T>::type value_or(V &&v) const
inline void reset() noexcept


Access comprehensive developer documentation for PyTorch

View Docs


Get in-depth tutorials for beginners and advanced developers

View Tutorials


Find development resources and get your questions answered

View Resources