summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDavid Schulz <david.schulz@qt.io>2018-05-16 10:23:49 +0200
committerDavid Schulz <david.schulz@qt.io>2018-05-16 08:34:33 +0000
commitd79c0ed5759c42ba96c12fa588c401128e79b388 (patch)
tree0f196d0eda7d1ca95fa7240ae1248acbff5f742c /src
parenta0c02b50da44ee07a2d6c2c2993109063dbe203f (diff)
Utils: add has_value to optional
Change-Id: I73af682c98d3fd9e97c169ffb3930950e2b0addb Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/libs/3rdparty/optional/optional.hpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/libs/3rdparty/optional/optional.hpp b/src/libs/3rdparty/optional/optional.hpp
index 13df7c92ac..607696d8e1 100644
--- a/src/libs/3rdparty/optional/optional.hpp
+++ b/src/libs/3rdparty/optional/optional.hpp
@@ -498,6 +498,7 @@ public:
// 20.5.4.5, Observers
explicit constexpr operator bool() const noexcept { return initialized(); }
+ constexpr bool has_value() const noexcept { return initialized(); }
constexpr T const* operator ->() const {
return TR2_OPTIONAL_ASSERTED_EXPRESSION(initialized(), dataptr());
@@ -693,7 +694,8 @@ public:
explicit constexpr operator bool() const noexcept {
return ref != nullptr;
}
-
+ constexpr bool has_value() const noexcept { return ref != nullptr; }
+
template <class V>
constexpr typename decay<T>::type value_or(V&& v) const
{