The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

remove_extent Class

Makes element type from array type.

template<class T>
    struct remove_extent;

template<class T>
using remove_extent_t = typename remove_extent<T>::type;


The type to modify.

An instance of remove_extent<T> holds a modified-type that is T1 when T is of the form T1[N], otherwise T.


#include <type_traits> 
#include <iostream> 
int main() 
    std::cout << "remove_extent_t<int> == "
        << typeid(std::remove_extent_t<int>).name()
        << std::endl;T
    std::cout << "remove_extent_t<int[5]> == "
        << typeid(std::remove_extent_t<int[5]>).name()
        << std::endl;T
    std::cout << "remove_extent_t<int[5][10]> == "
        << typeid(std::remove_extent_t<int[5][10]>).name()
        << std::endl; 
    return (0); 
remove_extent_t<int> == int
remove_extent_t<int[5]> == int
remove_extent_t<int[5][10]> == int [10]

Header: <type_traits>

Namespace: std

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
© 2014 Microsoft