Make annotations `SetOnce or optional` where feasible

This commit is contained in:
Mathias Baumann
2020-09-22 17:38:21 +02:00
parent d80a81b01b
commit dd81d05559
18 changed files with 194 additions and 105 deletions
+2
View File
@@ -79,6 +79,8 @@ public:
/// @throws BadSetOnceAccess when the stored value has not yet been set
T const* operator->() const { return std::addressof(**this); }
/// @return true if a value was assigned
bool set() const { return m_value.has_value(); }
private:
std::optional<T> m_value = std::nullopt;
};