mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Make annotations `SetOnce or optional` where feasible
This commit is contained in:
@@ -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;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user