# std::experimental::observer_ptr<W>::operator bool

> C++ Atlas: `cppatlas.com/w/cpp/experimental/observer_ptr/operator_bool` | Source: https://en.cppreference.com/w/cpp/experimental/observer_ptr/operator_bool | Domain: Technical specifications

Checks whether *this has an associated watched object, i.e. whether get() != nullptr.

## Official Specification Summary (cppreference)

```cpp
constexpr explicit operator bool() const noexcept; // (library fundamentals TS v2)
```

Checks whether `*this` has an associated watched object, i.e. whether `get() != nullptr`.

### Parameters

(none)

### Return value

`true` if `*this` has an associated watched object, `false` otherwise.

### Example

> Note: This section is incomplete Reason: no example

### See also

- [`get`](https://en.cppreference.com/w/cpp/experimental/observer_ptr/get): returns a pointer to the watched object (public member function)

---
Attribution: content from https://en.cppreference.com/w/cpp/experimental/observer_ptr/operator_bool (cppreference.com), licensed under CC-BY-SA 3.0 and GFDL. Modified: converted to markdown, study notes added. Offline snapshot of 9 February 2025.