Skip to content

Latest commit

 

History

History
66 lines (48 loc) · 1.37 KB

extent-class.md

File metadata and controls

66 lines (48 loc) · 1.37 KB
description title ms.date f1_keywords helpviewer_keywords ms.assetid
Learn more about: extent Class
extent Class
11/04/2016
type_traits/std::extent
extent class
extent
6d16263d-90b2-4330-9ec7-b59ed898792d

extent Class

Gets an array dimension.

Syntax

template <class Ty, unsigned I = 0>
struct extent;

Parameters

Ty
The type to query.

I
The array bound to query.

Remarks

If Ty is an array type that has at least I dimensions, the type query holds the number of elements in the dimension specified by I. If Ty is not an array type or its rank is less than I, or if I is zero and Ty is of type "array of unknown bound of U", the type query holds the value 0.

Example

// std__type_traits__extent.cpp
// compile with: /EHsc
#include <type_traits>
#include <iostream>

int main()
    {
    std::cout << "extent 0 == "
        << std::extent<int[5][10]>::value << std::endl;
    std::cout << "extent 1 == "
        << std::extent<int[5][10], 1>::value << std::endl;

    return (0);
    }
extent 0 == 5
extent 1 == 10

Requirements

Header: <type_traits>

Namespace: std

See also

<type_traits>
remove_all_extents Class
remove_extent Class