29 #ifndef BOOST_ARRAY_HPP
30 #define BOOST_ARRAY_HPP
32 #include <boost/detail/workaround.hpp>
34 #if BOOST_WORKAROUND(BOOST_MSVC, >= 1400)
35 # pragma warning(push)
36 # pragma warning(disable:4996) // 'std::equal': Function call with parameters that may be unsafe
37 # pragma warning(disable:4510) // boost::array<T,N>' : default constructor could not be generated
38 # pragma warning(disable:4610) // warning C4610: class 'boost::array<T,N>' can never be instantiated - user defined constructor required
43 #include <boost/assert.hpp>
44 #include <boost/swap.hpp>
47 #include <boost/detail/iterator.hpp>
48 #include <boost/throw_exception.hpp>
52 #include <boost/config.hpp>
57 template<
class T, std::
size_t N>
82 #if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !defined(BOOST_MSVC_STD_ITERATOR) && !defined(BOOST_NO_STD_ITERATOR_TRAITS)
85 #elif defined(_MSC_VER) && (_MSC_VER == 1300) && defined(BOOST_DINKUMWARE_STDLIB) && (BOOST_DINKUMWARE_STDLIB == 310)
91 #elif defined(_RWSTD_NO_CLASS_PARTIAL_SPEC)
92 typedef std::reverse_iterator<
iterator, std::random_access_iterator_tag,
94 typedef std::reverse_iterator<
const_iterator, std::random_access_iterator_tag,
121 BOOST_ASSERT( i <
N &&
"out of range" );
127 BOOST_ASSERT( i <
N &&
"out of range" );
158 static bool empty() {
return false; }
176 template <
typename T2>
192 std::out_of_range
e(
"array<>: index out of range");
193 boost::throw_exception(e);
199 #if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
223 #if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !defined(BOOST_MSVC_STD_ITERATOR) && !defined(BOOST_NO_STD_ITERATOR_TRAITS)
226 #elif defined(_MSC_VER) && (_MSC_VER == 1300) && defined(BOOST_DINKUMWARE_STDLIB) && (BOOST_DINKUMWARE_STDLIB == 310)
232 #elif defined(_RWSTD_NO_CLASS_PARTIAL_SPEC)
233 typedef std::reverse_iterator<
iterator, std::random_access_iterator_tag,
235 typedef std::reverse_iterator<
const_iterator, std::random_access_iterator_tag,
262 return failed_rangecheck();
267 return failed_rangecheck();
277 return failed_rangecheck();
282 return failed_rangecheck();
287 return failed_rangecheck();
292 return failed_rangecheck();
297 static bool empty() {
return true; }
312 template <
typename T2>
323 std::out_of_range
e(
"attempt to access element of an empty array");
324 boost::throw_exception(e);
325 #if defined(BOOST_NO_EXCEPTIONS) || (!defined(BOOST_MSVC) && !defined(__PATHSCALE__))
331 static T placeholder;
339 template<
class T, std::
size_t N>
343 template<
class T, std::
size_t N>
345 return std::lexicographical_compare(
x.begin(),
x.end(),
y.begin(),
y.end());
347 template<
class T, std::
size_t N>
351 template<
class T, std::
size_t N>
355 template<
class T, std::
size_t N>
359 template<
class T, std::
size_t N>
365 template<
class T, std::
size_t N>
370 #if defined(__SUNPRO_CC)
377 template <
typename T, std::
size_t N>
struct c_array
384 template <
typename T, std::
size_t N>
391 template <
typename T, std::
size_t N>
398 template <
typename T, std::
size_t N>
405 template <
typename T, std::
size_t N>
416 template <
typename T, std::
size_t N>
419 return static_cast<T(&)[
N]
>(arg);
423 template <
typename T, std::
size_t N>
426 return static_cast<T(&)[
N]
>(arg);
433 #if BOOST_WORKAROUND(BOOST_MSVC, >= 1400)
434 # pragma warning(pop)