Skip to content

Commit

Permalink
explicit operator bool() const noexcept
Browse files Browse the repository at this point in the history
  • Loading branch information
DennisOSRM committed Aug 27, 2014
1 parent f4bcf3f commit c77d98b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion optional.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,14 @@ namespace mapbox { namespace util {
variant_ = v;
}

bool operator!() const {
bool operator!() const noexcept{
return variant_.template is<none_t>();
}

explicit operator bool() const noexcept {
return variant_.template is<T>();
}

T const& get() const {
return variant_.template get<T>();
}
Expand Down

0 comments on commit c77d98b

Please sign in to comment.