remove_extent.qbk 964 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. [/
  2. Copyright 2007 John Maddock.
  3. Distributed under the Boost Software License, Version 1.0.
  4. (See accompanying file LICENSE_1_0.txt or copy at
  5. http://www.boost.org/LICENSE_1_0.txt).
  6. ]
  7. [section:remove_extent remove_extent]
  8. template <class T>
  9. struct remove_extent
  10. {
  11. typedef __below type;
  12. };
  13. template <class T> using remove_extent_t = typename remove_extent<T>::type; // C++11 and above
  14. __type If `T` is an array type, then removes the topmost array bound,
  15. otherwise leaves `T` unchanged.
  16. __std_ref 8.3.4.
  17. [all_compilers]
  18. __header ` #include <boost/type_traits/remove_extent.hpp>` or ` #include <boost/type_traits.hpp>`
  19. [table Examples
  20. [ [Expression] [Result Type]]
  21. [[`remove_extent<int>::type`][`int`]]
  22. [[`remove_extent<int const[2]>::type`] [`int const`]]
  23. [[`remove_extent<int[2][4]>::type`] [`int[4]`]]
  24. [[`remove_extent<int[][2]>::type`] [`int[2]`]]
  25. [[`remove_extent<int const*>::type`] [`int const*`]]
  26. ]
  27. [endsect]