remove_all_extents.hpp 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. // (C) Copyright John Maddock 2005.
  2. // Use, modification and distribution are subject to the Boost Software License,
  3. // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
  4. // http://www.boost.org/LICENSE_1_0.txt).
  5. //
  6. // See http://www.boost.org/libs/type_traits for most recent version including documentation.
  7. #ifndef BOOST_TT_REMOVE_ALL_EXTENTS_HPP_INCLUDED
  8. #define BOOST_TT_REMOVE_ALL_EXTENTS_HPP_INCLUDED
  9. #include <boost/config.hpp>
  10. #include <cstddef> // size_t
  11. #include <boost/detail/workaround.hpp>
  12. namespace boost {
  13. template <class T> struct remove_all_extents{ typedef T type; };
  14. #if !defined(BOOST_NO_ARRAY_TYPE_SPECIALIZATIONS)
  15. template <class T, std::size_t N> struct remove_all_extents<T[N]> : public remove_all_extents<T>{};
  16. template <class T, std::size_t N> struct remove_all_extents<T const[N]> : public remove_all_extents<T const>{};
  17. template <class T, std::size_t N> struct remove_all_extents<T volatile[N]> : public remove_all_extents<T volatile>{};
  18. template <class T, std::size_t N> struct remove_all_extents<T const volatile[N]> : public remove_all_extents<T const volatile>{};
  19. #if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x610)) && !defined(__IBMCPP__) && !BOOST_WORKAROUND(__DMC__, BOOST_TESTED_AT(0x840))
  20. template <class T> struct remove_all_extents<T[]> : public remove_all_extents<T>{};
  21. template <class T> struct remove_all_extents<T const[]> : public remove_all_extents<T const>{};
  22. template <class T> struct remove_all_extents<T volatile[]> : public remove_all_extents<T volatile>{};
  23. template <class T> struct remove_all_extents<T const volatile[]> : public remove_all_extents<T const volatile>{};
  24. #endif
  25. #endif
  26. #if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES)
  27. template <class T> using remove_all_extents_t = typename remove_all_extents<T>::type;
  28. #endif
  29. } // namespace boost
  30. #endif // BOOST_TT_REMOVE_BOUNDS_HPP_INCLUDED