A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://en.cppreference.com/w/cpp/language/../algorithm/../utility/variant/variant_size.html below:

std::variant_size, std::variant_size_v - cppreference.com

template< class T >
struct variant_size; /* undefined */

(1) (since C++17) (2) (since C++17)

template< class T >
class variant_size<const T>;

(3) (since C++17)

template< class T >
class variant_size<volatile T>;

(4) (since C++17)
(deprecated in C++20)

template< class T >
class variant_size<const volatile T>;

(5) (since C++17)
(deprecated in C++20)

Provides access to the number of alternatives in a possibly cv-qualified variant as a compile-time constant expression.

Formally,

[edit] Helper variable template template< class T >
constexpr std::size_t variant_size_v = std::variant_size<T>::value;
(since C++17) Inherited from std::integral_constant Member constants sizeof...(Types)
(public static member constant) Member functions converts the object to std::size_t, returns value
(public member function) returns value
(public member function) Member types [edit] Notes

All specializations of std::variant_size satisfy UnaryTypeTrait with base characteristic std::integral_constant<std::size_t, N> for some N.

[edit] Example [edit] See also

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4