1+++
2title = "`explicit operator bool() const noexcept`"
3description = "Returns true if a value is present. Constexpr, never throws."
4categories = ["observers"]
5weight = 590
6+++
7
8Returns true if a value is present. Constexpr where possible. Alias for {{% api "bool has_value() const noexcept" %}}.
9
10*Requires*: Always available.
11
12*Complexity*: Constant time.
13
14*Guarantees*: Never throws an exception.
15