Udostępnij za pośrednictwem


remove_extent Class

Makes element type from array type.

template<class Ty>
    struct remove_extent;

Parameters

  • Ty
    The type to modify.

Remarks

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

Example

 

// 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]

Requirements

Header: <type_traits>

Namespace: std

See Also

Reference

<type_traits>

remove_all_extents Class

Other Resources

<type_traits> Members