2004-10-08 06:06:23 +08:00
|
|
|
// class template array -*- C++ -*-
|
|
|
|
|
2006-02-01 01:46:07 +08:00
|
|
|
// Copyright (C) 2004, 2005, 2006 Free Software Foundation, Inc.
|
2004-10-08 06:06:23 +08:00
|
|
|
//
|
|
|
|
// This file is part of the GNU ISO C++ Library. This library is free
|
|
|
|
// software; you can redistribute it and/or modify it under the
|
|
|
|
// terms of the GNU General Public License as published by the
|
|
|
|
// Free Software Foundation; either version 2, or (at your option)
|
|
|
|
// any later version.
|
|
|
|
|
|
|
|
// This library is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
// GNU General Public License for more details.
|
|
|
|
|
|
|
|
// You should have received a copy of the GNU General Public License along
|
|
|
|
// with this library; see the file COPYING. If not, write to the Free
|
2005-08-17 10:28:44 +08:00
|
|
|
// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
|
2004-10-08 06:06:23 +08:00
|
|
|
// USA.
|
|
|
|
|
|
|
|
// As a special exception, you may use this file as part of a free software
|
|
|
|
// library without restriction. Specifically, if other files instantiate
|
|
|
|
// templates or use macros or inline functions from this file, or you compile
|
|
|
|
// this file and link it with other files to produce an executable, this
|
|
|
|
// file does not by itself cause the resulting executable to be covered by
|
|
|
|
// the GNU General Public License. This exception does not however
|
|
|
|
// invalidate any other reasons why the executable file might be covered by
|
|
|
|
// the GNU General Public License.
|
|
|
|
|
locale_facets.h (isspace, [...]): Add doxygen markup.
2004-11-22 Benjamin Kosnik <bkoz@redhat.com>
* include/bits/locale_facets.h (isspace, isprint, isupper,
islower, isalpha, isdigit, ispunct, isxdigit, isalnum, isgraph,
toupper, tolower): Add doxygen markup.
(codecvt_byname, ctype_byname, numpunct_byname, collate_byname,
time_get_byname, time_put_byname, moneypunct_byname,
messages_byname): Same.
* include/std/std_fstream.h: Remove superfluous markup.
* include/std/std_sstream.h: Same.
* include/std/std_streambuf.h: Same.
* include/ext/enc_filebuf.h: Adjust markup.
* include/ext/stdio_filebuf.h: Same.
* include/ext/stdio_sync_filebuf.h: Same.
* include/bits/codecvt.h: Same.
* config/os/gnu-linux/ctype_base.h: Same.
* config/locale/ieee_1003.1-2001/codecvt_specializations.h: Same.
* include/tr1/array: Add markup.
* include/tr1/tuple: Same.
* docs/doxygen/run_doxygen: Print arguments.
* docs/doxygen/user.cfg.in: Tweaks.
From-SVN: r91080
2004-11-23 17:18:41 +08:00
|
|
|
/** @file
|
|
|
|
* This is a TR1 C++ Library header.
|
|
|
|
*/
|
|
|
|
|
2006-12-05 18:57:09 +08:00
|
|
|
#ifndef _TR1_ARRAY
|
|
|
|
#define _TR1_ARRAY 1
|
2004-10-08 06:06:23 +08:00
|
|
|
|
|
|
|
#include <new>
|
|
|
|
#include <iterator>
|
array (array): Make safe for zero-sized arrays.
2004-10-21 Benjamin Kosnik <bkoz@redhat.com>
* include/tr1/array (array): Make safe for zero-sized arrays.
(array::end): Return one past the end.
(array::at): Use __throw_out_of_range, include functexcept.h.
(operator==): Implement.
(operator!=): Same.
(operator<): Same.
(operator>): Same.
(operator>=): Same.
(operator<=): Same.
* testsuite/tr1/6_containers/array/capacity/(empty.cc,
max_size.cc, size.cc): New.
* testsuite/tr1/6_containers/array/comparison_operators/(equal.cc,
greater.cc, greater_or_equal.cc, less.cc, less_or_equal.cc,
not_equal): New.
* testsuite/tr1/6_containers/array/cons/aggregate_initialization.cc:
New.
* testsuite/tr1/6_containers/array/element_access/at_out_of_range.cc:
New.
* testsuite/tr1/6_containers/array/iterators/end_is_one_past.cc: New.
* testsuite/tr1/6_containers/array/requirements/(contiguous.cc,
instantiate, typedefs, zero_size_arrays): New.
From-SVN: r89429
2004-10-22 13:32:16 +08:00
|
|
|
#include <algorithm>
|
2005-08-26 23:52:53 +08:00
|
|
|
#include <cstddef>
|
array (array): Make safe for zero-sized arrays.
2004-10-21 Benjamin Kosnik <bkoz@redhat.com>
* include/tr1/array (array): Make safe for zero-sized arrays.
(array::end): Return one past the end.
(array::at): Use __throw_out_of_range, include functexcept.h.
(operator==): Implement.
(operator!=): Same.
(operator<): Same.
(operator>): Same.
(operator>=): Same.
(operator<=): Same.
* testsuite/tr1/6_containers/array/capacity/(empty.cc,
max_size.cc, size.cc): New.
* testsuite/tr1/6_containers/array/comparison_operators/(equal.cc,
greater.cc, greater_or_equal.cc, less.cc, less_or_equal.cc,
not_equal): New.
* testsuite/tr1/6_containers/array/cons/aggregate_initialization.cc:
New.
* testsuite/tr1/6_containers/array/element_access/at_out_of_range.cc:
New.
* testsuite/tr1/6_containers/array/iterators/end_is_one_past.cc: New.
* testsuite/tr1/6_containers/array/requirements/(contiguous.cc,
instantiate, typedefs, zero_size_arrays): New.
From-SVN: r89429
2004-10-22 13:32:16 +08:00
|
|
|
#include <bits/functexcept.h>
|
2006-10-29 06:02:44 +08:00
|
|
|
#include <ext/type_traits.h>
|
2004-10-08 06:06:23 +08:00
|
|
|
|
|
|
|
//namespace std::tr1
|
|
|
|
namespace std
|
|
|
|
{
|
2005-12-19 08:56:05 +08:00
|
|
|
_GLIBCXX_BEGIN_NAMESPACE(tr1)
|
|
|
|
|
locale_facets.h (isspace, [...]): Add doxygen markup.
2004-11-22 Benjamin Kosnik <bkoz@redhat.com>
* include/bits/locale_facets.h (isspace, isprint, isupper,
islower, isalpha, isdigit, ispunct, isxdigit, isalnum, isgraph,
toupper, tolower): Add doxygen markup.
(codecvt_byname, ctype_byname, numpunct_byname, collate_byname,
time_get_byname, time_put_byname, moneypunct_byname,
messages_byname): Same.
* include/std/std_fstream.h: Remove superfluous markup.
* include/std/std_sstream.h: Same.
* include/std/std_streambuf.h: Same.
* include/ext/enc_filebuf.h: Adjust markup.
* include/ext/stdio_filebuf.h: Same.
* include/ext/stdio_sync_filebuf.h: Same.
* include/bits/codecvt.h: Same.
* config/os/gnu-linux/ctype_base.h: Same.
* config/locale/ieee_1003.1-2001/codecvt_specializations.h: Same.
* include/tr1/array: Add markup.
* include/tr1/tuple: Same.
* docs/doxygen/run_doxygen: Print arguments.
* docs/doxygen/user.cfg.in: Tweaks.
From-SVN: r91080
2004-11-23 17:18:41 +08:00
|
|
|
/// @brief struct array [6.2.2].
|
|
|
|
/// NB: Requires complete type _Tp.
|
2006-10-29 06:02:44 +08:00
|
|
|
template<typename _Tp, std::size_t _Nm>
|
2004-10-08 06:06:23 +08:00
|
|
|
struct array
|
|
|
|
{
|
2006-02-25 03:13:49 +08:00
|
|
|
typedef _Tp value_type;
|
|
|
|
typedef value_type& reference;
|
|
|
|
typedef const value_type& const_reference;
|
|
|
|
typedef value_type* iterator;
|
|
|
|
typedef const value_type* const_iterator;
|
|
|
|
typedef std::size_t size_type;
|
|
|
|
typedef std::ptrdiff_t difference_type;
|
|
|
|
typedef std::reverse_iterator<iterator> reverse_iterator;
|
|
|
|
typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
|
2004-10-08 06:06:23 +08:00
|
|
|
|
array (array): Make safe for zero-sized arrays.
2004-10-21 Benjamin Kosnik <bkoz@redhat.com>
* include/tr1/array (array): Make safe for zero-sized arrays.
(array::end): Return one past the end.
(array::at): Use __throw_out_of_range, include functexcept.h.
(operator==): Implement.
(operator!=): Same.
(operator<): Same.
(operator>): Same.
(operator>=): Same.
(operator<=): Same.
* testsuite/tr1/6_containers/array/capacity/(empty.cc,
max_size.cc, size.cc): New.
* testsuite/tr1/6_containers/array/comparison_operators/(equal.cc,
greater.cc, greater_or_equal.cc, less.cc, less_or_equal.cc,
not_equal): New.
* testsuite/tr1/6_containers/array/cons/aggregate_initialization.cc:
New.
* testsuite/tr1/6_containers/array/element_access/at_out_of_range.cc:
New.
* testsuite/tr1/6_containers/array/iterators/end_is_one_past.cc: New.
* testsuite/tr1/6_containers/array/requirements/(contiguous.cc,
instantiate, typedefs, zero_size_arrays): New.
From-SVN: r89429
2004-10-22 13:32:16 +08:00
|
|
|
// Support for zero-sized arrays mandatory.
|
2006-02-01 01:46:07 +08:00
|
|
|
value_type _M_instance[_Nm ? _Nm : 1] __attribute__((__aligned__));
|
2004-10-08 06:06:23 +08:00
|
|
|
|
|
|
|
// No explicit construct/copy/destroy for aggregate type.
|
|
|
|
|
|
|
|
void
|
2006-02-25 03:13:49 +08:00
|
|
|
assign(const value_type& __u)
|
|
|
|
{ std::fill_n(begin(), size(), __u); }
|
2004-10-08 06:06:23 +08:00
|
|
|
|
|
|
|
void
|
2006-02-25 03:13:49 +08:00
|
|
|
swap(array& __other)
|
|
|
|
{ std::swap_ranges(begin(), end(), __other.begin()); }
|
2004-10-08 06:06:23 +08:00
|
|
|
|
|
|
|
// Iterators.
|
2005-09-11 17:48:41 +08:00
|
|
|
iterator
|
2004-10-08 06:06:23 +08:00
|
|
|
begin()
|
2005-09-11 17:48:41 +08:00
|
|
|
{ return iterator(&_M_instance[0]); }
|
2004-10-08 06:06:23 +08:00
|
|
|
|
2005-09-11 17:48:41 +08:00
|
|
|
const_iterator
|
2004-10-08 06:06:23 +08:00
|
|
|
begin() const
|
2005-09-11 17:48:41 +08:00
|
|
|
{ return const_iterator(&_M_instance[0]); }
|
2004-10-08 06:06:23 +08:00
|
|
|
|
2005-09-11 17:48:41 +08:00
|
|
|
iterator
|
2004-10-08 06:06:23 +08:00
|
|
|
end()
|
2005-09-11 17:48:41 +08:00
|
|
|
{ return iterator(&_M_instance[_Nm]); }
|
2004-10-08 06:06:23 +08:00
|
|
|
|
2005-09-11 17:48:41 +08:00
|
|
|
const_iterator
|
2004-10-08 06:06:23 +08:00
|
|
|
end() const
|
2005-09-11 17:48:41 +08:00
|
|
|
{ return const_iterator(&_M_instance[_Nm]); }
|
2004-10-08 06:06:23 +08:00
|
|
|
|
|
|
|
reverse_iterator
|
|
|
|
rbegin()
|
2005-08-26 23:52:53 +08:00
|
|
|
{ return reverse_iterator(end()); }
|
2004-10-08 06:06:23 +08:00
|
|
|
|
|
|
|
const_reverse_iterator
|
|
|
|
rbegin() const
|
2005-08-26 23:52:53 +08:00
|
|
|
{ return const_reverse_iterator(end()); }
|
2004-10-08 06:06:23 +08:00
|
|
|
|
|
|
|
reverse_iterator
|
|
|
|
rend()
|
2005-08-26 23:52:53 +08:00
|
|
|
{ return reverse_iterator(begin()); }
|
2004-10-08 06:06:23 +08:00
|
|
|
|
|
|
|
const_reverse_iterator
|
|
|
|
rend() const
|
2005-08-26 23:52:53 +08:00
|
|
|
{ return const_reverse_iterator(begin()); }
|
2004-10-08 06:06:23 +08:00
|
|
|
|
|
|
|
// Capacity.
|
|
|
|
size_type
|
array (array): Make safe for zero-sized arrays.
2004-10-21 Benjamin Kosnik <bkoz@redhat.com>
* include/tr1/array (array): Make safe for zero-sized arrays.
(array::end): Return one past the end.
(array::at): Use __throw_out_of_range, include functexcept.h.
(operator==): Implement.
(operator!=): Same.
(operator<): Same.
(operator>): Same.
(operator>=): Same.
(operator<=): Same.
* testsuite/tr1/6_containers/array/capacity/(empty.cc,
max_size.cc, size.cc): New.
* testsuite/tr1/6_containers/array/comparison_operators/(equal.cc,
greater.cc, greater_or_equal.cc, less.cc, less_or_equal.cc,
not_equal): New.
* testsuite/tr1/6_containers/array/cons/aggregate_initialization.cc:
New.
* testsuite/tr1/6_containers/array/element_access/at_out_of_range.cc:
New.
* testsuite/tr1/6_containers/array/iterators/end_is_one_past.cc: New.
* testsuite/tr1/6_containers/array/requirements/(contiguous.cc,
instantiate, typedefs, zero_size_arrays): New.
From-SVN: r89429
2004-10-22 13:32:16 +08:00
|
|
|
size() const { return _Nm; }
|
2004-10-08 06:06:23 +08:00
|
|
|
|
|
|
|
size_type
|
array (array): Make safe for zero-sized arrays.
2004-10-21 Benjamin Kosnik <bkoz@redhat.com>
* include/tr1/array (array): Make safe for zero-sized arrays.
(array::end): Return one past the end.
(array::at): Use __throw_out_of_range, include functexcept.h.
(operator==): Implement.
(operator!=): Same.
(operator<): Same.
(operator>): Same.
(operator>=): Same.
(operator<=): Same.
* testsuite/tr1/6_containers/array/capacity/(empty.cc,
max_size.cc, size.cc): New.
* testsuite/tr1/6_containers/array/comparison_operators/(equal.cc,
greater.cc, greater_or_equal.cc, less.cc, less_or_equal.cc,
not_equal): New.
* testsuite/tr1/6_containers/array/cons/aggregate_initialization.cc:
New.
* testsuite/tr1/6_containers/array/element_access/at_out_of_range.cc:
New.
* testsuite/tr1/6_containers/array/iterators/end_is_one_past.cc: New.
* testsuite/tr1/6_containers/array/requirements/(contiguous.cc,
instantiate, typedefs, zero_size_arrays): New.
From-SVN: r89429
2004-10-22 13:32:16 +08:00
|
|
|
max_size() const { return _Nm; }
|
2004-10-08 06:06:23 +08:00
|
|
|
|
|
|
|
bool
|
array (array): Make safe for zero-sized arrays.
2004-10-21 Benjamin Kosnik <bkoz@redhat.com>
* include/tr1/array (array): Make safe for zero-sized arrays.
(array::end): Return one past the end.
(array::at): Use __throw_out_of_range, include functexcept.h.
(operator==): Implement.
(operator!=): Same.
(operator<): Same.
(operator>): Same.
(operator>=): Same.
(operator<=): Same.
* testsuite/tr1/6_containers/array/capacity/(empty.cc,
max_size.cc, size.cc): New.
* testsuite/tr1/6_containers/array/comparison_operators/(equal.cc,
greater.cc, greater_or_equal.cc, less.cc, less_or_equal.cc,
not_equal): New.
* testsuite/tr1/6_containers/array/cons/aggregate_initialization.cc:
New.
* testsuite/tr1/6_containers/array/element_access/at_out_of_range.cc:
New.
* testsuite/tr1/6_containers/array/iterators/end_is_one_past.cc: New.
* testsuite/tr1/6_containers/array/requirements/(contiguous.cc,
instantiate, typedefs, zero_size_arrays): New.
From-SVN: r89429
2004-10-22 13:32:16 +08:00
|
|
|
empty() const { return size() == 0; }
|
2004-10-08 06:06:23 +08:00
|
|
|
|
|
|
|
// Element access.
|
2006-10-29 06:02:44 +08:00
|
|
|
reference
|
2004-10-08 06:06:23 +08:00
|
|
|
operator[](size_type __n)
|
2005-08-26 23:52:53 +08:00
|
|
|
{ return _M_instance[__n]; }
|
2004-10-08 06:06:23 +08:00
|
|
|
|
2006-10-29 06:02:44 +08:00
|
|
|
const_reference
|
2004-10-08 06:06:23 +08:00
|
|
|
operator[](size_type __n) const
|
2005-08-26 23:52:53 +08:00
|
|
|
{ return _M_instance[__n]; }
|
2004-10-08 06:06:23 +08:00
|
|
|
|
2006-10-29 06:02:44 +08:00
|
|
|
reference
|
2004-10-08 06:06:23 +08:00
|
|
|
at(size_type __n)
|
2006-10-29 06:02:44 +08:00
|
|
|
{ return _M_at<_Nm>(__n); }
|
|
|
|
|
|
|
|
const_reference
|
|
|
|
at(size_type __n) const
|
|
|
|
{ return _M_at<_Nm>(__n); }
|
2004-10-08 06:06:23 +08:00
|
|
|
|
|
|
|
reference
|
2005-08-26 23:52:53 +08:00
|
|
|
front()
|
|
|
|
{ return *begin(); }
|
2004-10-08 06:06:23 +08:00
|
|
|
|
|
|
|
const_reference
|
2005-08-26 23:52:53 +08:00
|
|
|
front() const
|
|
|
|
{ return *begin(); }
|
2004-10-08 06:06:23 +08:00
|
|
|
|
|
|
|
reference
|
2005-08-26 23:52:53 +08:00
|
|
|
back()
|
2006-10-29 06:02:44 +08:00
|
|
|
{ return _Nm ? *(end() - 1) : *end(); }
|
2004-10-08 06:06:23 +08:00
|
|
|
|
|
|
|
const_reference
|
2005-08-26 23:52:53 +08:00
|
|
|
back() const
|
2006-10-29 06:02:44 +08:00
|
|
|
{ return _Nm ? *(end() - 1) : *end(); }
|
2004-10-08 06:06:23 +08:00
|
|
|
|
|
|
|
_Tp*
|
2005-08-26 23:52:53 +08:00
|
|
|
data()
|
|
|
|
{ return &_M_instance[0]; }
|
2004-10-08 06:06:23 +08:00
|
|
|
|
|
|
|
const _Tp*
|
2005-08-26 23:52:53 +08:00
|
|
|
data() const
|
|
|
|
{ return &_M_instance[0]; }
|
2006-10-29 06:02:44 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
template<std::size_t _Mm>
|
|
|
|
typename __gnu_cxx::__enable_if<_Mm, reference>::__type
|
|
|
|
_M_at(size_type __n)
|
|
|
|
{
|
|
|
|
if (__builtin_expect(__n >= _Mm, false))
|
2006-11-07 20:33:20 +08:00
|
|
|
std::__throw_out_of_range(__N("array::_M_at"));
|
2006-10-29 06:02:44 +08:00
|
|
|
return _M_instance[__n];
|
|
|
|
}
|
|
|
|
|
|
|
|
// Avoid "unsigned comparison with zero" warnings.
|
|
|
|
template<std::size_t _Mm>
|
|
|
|
typename __gnu_cxx::__enable_if<!_Mm, reference>::__type
|
|
|
|
_M_at(size_type)
|
|
|
|
{
|
2006-11-07 20:33:20 +08:00
|
|
|
std::__throw_out_of_range(__N("array::_M_at"));
|
2006-10-29 06:02:44 +08:00
|
|
|
return _M_instance[0];
|
|
|
|
}
|
|
|
|
|
|
|
|
template<std::size_t _Mm>
|
|
|
|
typename __gnu_cxx::__enable_if<_Mm, const_reference>::__type
|
|
|
|
_M_at(size_type __n) const
|
|
|
|
{
|
|
|
|
if (__builtin_expect(__n >= _Mm, false))
|
2006-11-07 20:33:20 +08:00
|
|
|
std::__throw_out_of_range(__N("array::_M_at"));
|
2006-10-29 06:02:44 +08:00
|
|
|
return _M_instance[__n];
|
|
|
|
}
|
|
|
|
|
|
|
|
template<std::size_t _Mm>
|
|
|
|
typename __gnu_cxx::__enable_if<!_Mm, const_reference>::__type
|
|
|
|
_M_at(size_type) const
|
|
|
|
{
|
2006-11-07 20:33:20 +08:00
|
|
|
std::__throw_out_of_range(__N("array::_M_at"));
|
2006-10-29 06:02:44 +08:00
|
|
|
return _M_instance[0];
|
|
|
|
}
|
2004-10-08 06:06:23 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
// Array comparisons.
|
2005-08-26 23:52:53 +08:00
|
|
|
template<typename _Tp, std::size_t _Nm>
|
2006-02-25 03:13:49 +08:00
|
|
|
inline bool
|
2005-08-26 23:52:53 +08:00
|
|
|
operator==(const array<_Tp, _Nm>& __one, const array<_Tp, _Nm>& __two)
|
|
|
|
{ return std::equal(__one.begin(), __one.end(), __two.begin()); }
|
|
|
|
|
|
|
|
template<typename _Tp, std::size_t _Nm>
|
2006-02-25 03:13:49 +08:00
|
|
|
inline bool
|
2005-08-26 23:52:53 +08:00
|
|
|
operator!=(const array<_Tp, _Nm>& __one, const array<_Tp, _Nm>& __two)
|
|
|
|
{ return !(__one == __two); }
|
|
|
|
|
|
|
|
template<typename _Tp, std::size_t _Nm>
|
2006-02-25 03:13:49 +08:00
|
|
|
inline bool
|
2005-08-26 23:52:53 +08:00
|
|
|
operator<(const array<_Tp, _Nm>& __a, const array<_Tp, _Nm>& __b)
|
|
|
|
{
|
|
|
|
return std::lexicographical_compare(__a.begin(), __a.end(),
|
|
|
|
__b.begin(), __b.end());
|
|
|
|
}
|
|
|
|
|
|
|
|
template<typename _Tp, std::size_t _Nm>
|
2006-02-25 03:13:49 +08:00
|
|
|
inline bool
|
2005-08-26 23:52:53 +08:00
|
|
|
operator>(const array<_Tp, _Nm>& __one, const array<_Tp, _Nm>& __two)
|
|
|
|
{ return __two < __one; }
|
|
|
|
|
|
|
|
template<typename _Tp, std::size_t _Nm>
|
2006-02-25 03:13:49 +08:00
|
|
|
inline bool
|
2005-08-26 23:52:53 +08:00
|
|
|
operator<=(const array<_Tp, _Nm>& __one, const array<_Tp, _Nm>& __two)
|
|
|
|
{ return !(__one > __two); }
|
|
|
|
|
|
|
|
template<typename _Tp, std::size_t _Nm>
|
2006-02-25 03:13:49 +08:00
|
|
|
inline bool
|
2005-08-26 23:52:53 +08:00
|
|
|
operator>=(const array<_Tp, _Nm>& __one, const array<_Tp, _Nm>& __two)
|
|
|
|
{ return !(__one < __two); }
|
2004-10-08 06:06:23 +08:00
|
|
|
|
locale_facets.h (isspace, [...]): Add doxygen markup.
2004-11-22 Benjamin Kosnik <bkoz@redhat.com>
* include/bits/locale_facets.h (isspace, isprint, isupper,
islower, isalpha, isdigit, ispunct, isxdigit, isalnum, isgraph,
toupper, tolower): Add doxygen markup.
(codecvt_byname, ctype_byname, numpunct_byname, collate_byname,
time_get_byname, time_put_byname, moneypunct_byname,
messages_byname): Same.
* include/std/std_fstream.h: Remove superfluous markup.
* include/std/std_sstream.h: Same.
* include/std/std_streambuf.h: Same.
* include/ext/enc_filebuf.h: Adjust markup.
* include/ext/stdio_filebuf.h: Same.
* include/ext/stdio_sync_filebuf.h: Same.
* include/bits/codecvt.h: Same.
* config/os/gnu-linux/ctype_base.h: Same.
* config/locale/ieee_1003.1-2001/codecvt_specializations.h: Same.
* include/tr1/array: Add markup.
* include/tr1/tuple: Same.
* docs/doxygen/run_doxygen: Print arguments.
* docs/doxygen/user.cfg.in: Tweaks.
From-SVN: r91080
2004-11-23 17:18:41 +08:00
|
|
|
// Specialized algorithms [6.2.2.2].
|
2005-08-26 23:52:53 +08:00
|
|
|
template<typename _Tp, std::size_t _Nm>
|
2006-02-25 03:13:49 +08:00
|
|
|
inline void
|
2005-08-26 23:52:53 +08:00
|
|
|
swap(array<_Tp, _Nm>& __one, array<_Tp, _Nm>& __two)
|
2006-02-25 03:13:49 +08:00
|
|
|
{ std::swap_ranges(__one.begin(), __one.end(), __two.begin()); }
|
2005-08-26 23:52:53 +08:00
|
|
|
|
|
|
|
// Tuple interface to class template array [6.2.2.5].
|
|
|
|
template<typename _Tp> class tuple_size;
|
|
|
|
template<int _Int, typename _Tp> class tuple_element;
|
2006-10-29 06:02:44 +08:00
|
|
|
|
2005-08-26 23:52:53 +08:00
|
|
|
template<typename _Tp, std::size_t _Nm>
|
|
|
|
struct tuple_size<array<_Tp, _Nm> >
|
|
|
|
{ static const int value = _Nm; };
|
2006-10-29 06:02:44 +08:00
|
|
|
|
2006-10-31 06:22:38 +08:00
|
|
|
template<typename _Tp, std::size_t _Nm>
|
|
|
|
const int tuple_size<array<_Tp, _Nm> >::value;
|
|
|
|
|
2005-08-26 23:52:53 +08:00
|
|
|
template<int _Int, typename _Tp, std::size_t _Nm>
|
|
|
|
struct tuple_element<_Int, array<_Tp, _Nm> >
|
|
|
|
{ typedef _Tp type; };
|
|
|
|
|
|
|
|
template<int _Int, typename _Tp, std::size_t _Nm>
|
2006-02-25 03:13:49 +08:00
|
|
|
inline _Tp&
|
2005-08-26 23:52:53 +08:00
|
|
|
get(array<_Tp, _Nm>& __arr)
|
|
|
|
{ return __arr[_Int]; }
|
|
|
|
|
|
|
|
template<int _Int, typename _Tp, std::size_t _Nm>
|
2006-02-25 03:13:49 +08:00
|
|
|
inline const _Tp&
|
2005-08-26 23:52:53 +08:00
|
|
|
get(const array<_Tp, _Nm>& __arr)
|
|
|
|
{ return __arr[_Int]; }
|
2005-12-19 08:56:05 +08:00
|
|
|
|
|
|
|
_GLIBCXX_END_NAMESPACE
|
2004-10-08 06:06:23 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|