bsl::variant::index

Return the index of the currently managed alternative.

Synopsis

Declared in <bslstl_variant.h>

std::size_t
index() const noexcept;

Description

Return the index of the alternative currently managed by this variant object, or bsl::variant_npos if this object is valueless by exception. This method differs from the standard in the following way: * constexpr is not implemented This is because no constructors are currently constexpr and there is no way to test the constexpr property of this function.

Return Value

index of the active alternative, or variant_npos