mirror of
https://github.com/TartanLlama/optional.git
synced 2025-07-29 17:37:13 +02:00
@ -1032,32 +1032,12 @@ public:
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/// Takes the value out of the optional, leaving it empty
|
/// Takes the value out of the optional, leaving it empty
|
||||||
optional take() & {
|
optional take() {
|
||||||
optional ret = *this;
|
|
||||||
reset();
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
optional take() const & {
|
|
||||||
optional ret = *this;
|
|
||||||
reset();
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
optional take() && {
|
|
||||||
optional ret = std::move(*this);
|
optional ret = std::move(*this);
|
||||||
reset();
|
reset();
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef TL_OPTIONAL_NO_CONSTRR
|
|
||||||
optional take() const && {
|
|
||||||
optional ret = std::move(*this);
|
|
||||||
reset();
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
using value_type = T;
|
using value_type = T;
|
||||||
|
|
||||||
/// Constructs an optional that does not contain a value.
|
/// Constructs an optional that does not contain a value.
|
||||||
@ -1926,32 +1906,12 @@ public:
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/// Takes the value out of the optional, leaving it empty
|
/// Takes the value out of the optional, leaving it empty
|
||||||
optional take() & {
|
optional take() {
|
||||||
optional ret = *this;
|
|
||||||
reset();
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
optional take() const & {
|
|
||||||
optional ret = *this;
|
|
||||||
reset();
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
optional take() && {
|
|
||||||
optional ret = std::move(*this);
|
optional ret = std::move(*this);
|
||||||
reset();
|
reset();
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef TL_OPTIONAL_NO_CONSTRR
|
|
||||||
optional take() const && {
|
|
||||||
optional ret = std::move(*this);
|
|
||||||
reset();
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
using value_type = T &;
|
using value_type = T &;
|
||||||
|
|
||||||
/// Constructs an optional that does not contain a value.
|
/// Constructs an optional that does not contain a value.
|
||||||
|
Reference in New Issue
Block a user