Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

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::tr1::remove_extent<int>::type).name() 
        << std::endl; 
    std::cout << "remove_extent<int[5]> == " 
        << typeid(std::tr1::remove_extent<int[5]>::type).name() 
        << std::endl; 
    std::cout << "remove_extent<int[5][10]> == " 
        << typeid(std::tr1::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::tr1

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.