Skip to content

Commit

Permalink
Add has_value to conditional.
Browse files Browse the repository at this point in the history
  • Loading branch information
john-preston committed Aug 25, 2022
1 parent dec8f54 commit 36fb95c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tl/tl_basic_types.h
Expand Up @@ -671,6 +671,10 @@ class conditional {
return _value ? _value->v : Inner();
}

constexpr bool has_value() const noexcept {
return (_value != nullptr);
}

private:
const T *_value = nullptr;

Expand Down

0 comments on commit 36fb95c

Please sign in to comment.