Export (0) Print
Expand All
Expand Minimize

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;

T

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

Show:
© 2014 Microsoft