Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
remove_extent Class
Collapse the table of content
Expand the table of content

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

© 2015 Microsoft