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

remove_extent Class

Makes element type from array type.

template<class Ty>
    struct remove_extent;

Ty

The type to modify.

An instance of the type modifier holds a modified-type that is Ty1 when Ty is of the form Ty1[N], otherwise Ty.

 

// std_tr1__type_traits__remove_extent.cpp 
// compile with: /EHsc 
#include <type_traits> 
#include <iostream> 
 
int main() 
    { 
    std::cout << "remove_extent<int> == " 
        << typeid(std::remove_extent<int>::type).name() 
        << std::endl; 
    std::cout << "remove_extent<int[5]> == " 
        << typeid(std::remove_extent<int[5]>::type).name() 
        << std::endl; 
    std::cout << "remove_extent<int[5][10]> == " 
        << typeid(std::remove_extent<int[5][10]>::type).name() 
        << std::endl; 
 
    return (0); 
    } 
 
remove_extent<int> == int
remove_extent<int[5]> == int
remove_extent<int[5][10]> == int [10]

Header: <type_traits>

Namespace: std

Show:
© 2015 Microsoft