1
2// (C) Copyright Dave Abrahams, Steve Cleary, Beman Dawes, Howard
3// Hinnant & John Maddock 2000.
4// Use, modification and distribution are subject to the Boost Software License,
5// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
6// http://www.boost.org/LICENSE_1_0.txt).
7//
8// See http://www.boost.org/libs/type_traits for most recent version including documentation.
9
10
11// Some fixes for is_array are based on a newsgroup posting by Jonathan Lundquist.
12
13
14#ifndef BOOST_TT_IS_ARRAY_HPP_INCLUDED
15#define BOOST_TT_IS_ARRAY_HPP_INCLUDED
16
17#include <boost/type_traits/integral_constant.hpp>
18#include <cstddef>
19
20namespace boost {
21
22#if defined( __CODEGEARC__ )
23 template <class T> struct is_array : public integral_constant<bool, __is_array(T)> {};
24#else
25 template <class T> struct is_array : public false_type {};
26#if !defined(BOOST_NO_ARRAY_TYPE_SPECIALIZATIONS)
27 template <class T, std::size_t N> struct is_array<T[N]> : public true_type {};
28 template <class T, std::size_t N> struct is_array<T const[N]> : public true_type{};
29 template <class T, std::size_t N> struct is_array<T volatile[N]> : public true_type{};
30 template <class T, std::size_t N> struct is_array<T const volatile[N]> : public true_type{};
31#if !BOOST_WORKAROUND(__BORLANDC__, < 0x600) && !defined(__IBMCPP__) && !BOOST_WORKAROUND(__DMC__, BOOST_TESTED_AT(0x840))
32 template <class T> struct is_array<T[]> : public true_type{};
33 template <class T> struct is_array<T const[]> : public true_type{};
34 template <class T> struct is_array<T const volatile[]> : public true_type{};
35 template <class T> struct is_array<T volatile[]> : public true_type{};
36#endif
37#endif
38
39#endif
40
41} // namespace boost
42
43#endif // BOOST_TT_IS_ARRAY_HPP_INCLUDED
44