Namensräume
Varianten

std::tuple_size(std::array)

Aus cppreference.com
< cpp‎ | container‎ | array

 
 
 
std::array
Member-Funktionen
Original:
Member functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Elementzugriff zerstört
Original:
Element access
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
array::at
array::operator[]
array::front
array::back
array::data
Iteratoren
Original:
Iterators
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
array::begin
array::cbegin
array::end
array::cend
array::rbegin
array::crbegin
array::rend
array::crend
Kapazität
Original:
Capacity
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
array::empty
array::size
array::max_size
Modifiers
Original:
Modifiers
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
array::fill
array::swap
Non-Member-Funktionen
Original:
Non-member functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
get
swap
Helper-Klassen
Original:
Helper classes
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
tuple_size
tuple_element
 
definiert in Header <array>
template<class T, size_t N >

class tuple_size< array<T, N>>:
    public integral_constant<size_t, N>

{};
(1) (seit C++11)
Bietet Zugriff auf die Anzahl der Elemente in einem std::array als Compile-Zeit konstanter Ausdruck .
Original:
Provides access to the number of elements in an std::array as a compile-time constant expression.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Inhaltsverzeichnis

Inherited from std::integral_constant

Member constants

value
[statisch]
N, the number of elements in the array
(public static Mitglied konstanten)

Member functions

operator std::size_t
wandelt das Objekt std::size_t, gibt value
Original:
converts the object to std::size_t, returns value
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(öffentliche Elementfunktion)

Member types

Type
Original:
Type
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Definition
value_typestd::size_t
typestd::integral_constant<std::size_t, value>

[Bearbeiten]Beispiel

#include <iostream>#include <array>   template<class T>void test(T t){int a[std::tuple_size<T>::value];// can be used at compile timestd::cout<<std::tuple_size<T>::value<<'\n';}   int main(){std::array<float, 3> arr; test(arr);}

Output:

3

[Bearbeiten]Siehe auch

erhält die Größe der tuple bei der Kompilierung
Original:
obtains the size of tuple at compile time
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(class Template-Spezialisierung)[edit]
close