A RetroSearch Logo

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

Search Query:

Showing content from https://www.tutorialspoint.com/cpp_standard_library/cpp_array_tuple_size.htm below:

C++ Array Tuple Size

C++ Array Library - tuple_size() Function Description

The C++ function std::tuple_size(std::array) returns the total number of elements present in the container.

Declaration

Following is the declaration for std::tuple_size(std::array) function form std::array header.

template< class T, size_t N >
class tuple_size< array<T, N> > :
   public integral_constant&lg;size_t, N>
{ };
Parameters

T − type for which the tuple size is obtained.

Example

The following example shows the usage of std::tuple_size(std::array) function.

#include <iostream>
#include <array>

using namespace std;

int main(void) {

   typedef array<int, 4> arr;

   cout << "Size = " << tuple_size<arr>::value << endl;

   return 0;
}

Let us compile and run the above program, this will produce the following result −

Size = 4

array.htm


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