17 static_assert(!std::is_reference<T>::value,
"optional doesn't support references");
29 : m_value(std::
move(v))
34 explicit operator bool() const noexcept
39 T
const &operator*() const noexcept
49 optional &operator=(
const T &v)
noexcept
56 optional &operator=(T &&v)
noexcept
59 m_value = std::move(v);
73 bool m_hasValue =
false;
76template<
typename T,
typename U>
77bool operator==(
const optional<T> &lhs,
const optional<U> &rhs)
noexcept
79 const auto l =
static_cast<bool>(lhs), r =
static_cast<bool>(rhs);
80 return l && r ? *lhs == *rhs : !l && !r;
83template<
typename T,
typename U>
84bool operator!=(
const optional<T> &lhs,
const optional<U> &rhs)
noexcept
89template<
typename T,
typename U>
90bool operator==(
const optional<T> &lhs,
const U &rhs)
noexcept
92 return static_cast<bool>(lhs) && *lhs == rhs;
95template<
typename T,
typename U>
96bool operator!=(
const optional<T> &lhs,
const U &rhs)
noexcept
101template<
typename T,
typename U>
102bool operator==(
const T &lhs,
const optional<T> &rhs)
noexcept
107template<
typename T,
typename U>
108bool operator!=(
const T &lhs,
const optional<T> &rhs)
noexcept
110 return !(lhs == rhs);
KIOCORE_EXPORT CopyJob * move(const QList< QUrl > &src, const QUrl &dest, JobFlags flags=DefaultFlags)
KIOCORE_EXPORT bool operator!=(const UDSEntry &entry, const UDSEntry &other)
bool operator==(const StyleDelim &l, const StyleDelim &r)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:00:52 by
doxygen 1.12.0 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.