std::variant_npos - cppreference.com

##### cppreference.com

##### Search

Create account

##### Namespaces

- Page
- Discussion

##### Variants

##### Views

- View
- Edit
- History

##### Actions

# std::variant_npos

From cppreference.com
< cpp‎ | utility‎ | variant

Defined in header `<variant>` |  |
inline constexpr std::size_t variant_npos = -1; |  | (since C++17)

This is a special value equal to the largest value representable by the type `std::size_t`, used as the return type of index() when valueless_by_exception() is `true`

### [edit] See also

index | returns the zero-based index of the alternative held by the variant (public member function) [edit]
valueless_by_exception | checks if the variant is in the invalid state (public member function) [edit]

Retrieved from "http://en.cppreference.com/mwiki/index.php?title=cpp/utility/variant/variant_npos&oldid=90939"