2000-10-05 13:27:02 +02:00
|
|
|
// Character Traits for use by standard string and iostream -*- C++ -*-
|
|
|
|
|
2007-03-03 11:29:14 +01:00
|
|
|
// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
|
2010-02-04 19:20:34 +01:00
|
|
|
// 2006, 2007, 2008, 2009, 2010
|
2002-07-31 04:47:36 +02:00
|
|
|
// Free Software Foundation, Inc.
|
2000-10-05 13:27:02 +02: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
|
2009-04-09 17:00:19 +02:00
|
|
|
// Free Software Foundation; either version 3, or (at your option)
|
2000-10-05 13:27:02 +02:00
|
|
|
// 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.
|
|
|
|
|
2009-04-09 17:00:19 +02:00
|
|
|
// Under Section 7 of GPL version 3, you are granted additional
|
|
|
|
// permissions described in the GCC Runtime Library Exception, version
|
|
|
|
// 3.1, as published by the Free Software Foundation.
|
2000-10-05 13:27:02 +02:00
|
|
|
|
2009-04-09 17:00:19 +02:00
|
|
|
// You should have received a copy of the GNU General Public License and
|
|
|
|
// a copy of the GCC Runtime Library Exception along with this program;
|
|
|
|
// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
|
|
|
// <http://www.gnu.org/licenses/>.
|
2000-10-05 13:27:02 +02:00
|
|
|
|
2010-12-19 10:21:16 +01:00
|
|
|
/** @file bits/char_traits.h
|
c_io_stdio.h: Correct grammar in comments.
2001-11-02 Phil Edwards <pme@gcc.gnu.org>
* config/io/c_io_stdio.h: Correct grammar in comments.
* docs/doxygen/Intro.3: Expand "top-level" man page.
* docs/doxygen/doxygroups.cc: New module definitions (comments).
* docs/doxygen/mainpage.doxy: Tweaks.
* docs/doxygen/run_doxygen: Update Doxygen version, massage man pages.
Add @file hooks so that headers are considered to be documented.
* include/bits/basic_ios.h, include/bits/basic_file.h,
include/bits/basic_string.h, include/bits/boost_concept_check.h,
include/bits/char_traits.h, include/bits/codecvt.h,
include/bits/concept_check.h, include/bits/cpp_type_traits.h,
include/bits/fpos.h, include/bits/gslice.h, include/bits/gslice_array.h,
include/bits/indirect_array.h, include/bits/ios_base.h,
include/bits/locale_facets.h, include/bits/localefwd.h,
include/bits/mask_array.h, include/bits/pthread_allocimpl.h,
include/bits/slice.h, include/bits/slice_array.h,
include/bits/std_algorithm.h, include/bits/std_bitset.h,
include/bits/std_complex.h, include/bits/std_deque.h,
include/bits/std_fstream.h, include/bits/std_functional.h,
include/bits/std_iomanip.h, include/bits/std_ios.h,
include/bits/std_iosfwd.h, include/bits/std_iostream.h,
include/bits/std_istream.h, include/bits/std_iterator.h,
include/bits/std_limits.h, include/bits/std_list.h,
include/bits/std_locale.h, include/bits/std_map.h,
include/bits/std_memory.h, include/bits/std_numeric.h,
include/bits/std_ostream.h, include/bits/std_queue.h,
include/bits/std_set.h, include/bits/std_sstream.h,
include/bits/std_stack.h, include/bits/std_streambuf.h,
include/bits/std_string.h, include/bits/std_utility.h,
include/bits/std_valarray.h, include/bits/std_vector.h,
include/bits/stl_algo.h, include/bits/stl_alloc.h,
include/bits/stl_bvector.h, include/bits/stl_construct.h,
include/bits/stl_deque.h, include/bits/stl_heap.h,
include/bits/stl_iterator.h, include/bits/stl_iterator_base_funcs.h,
include/bits/stl_iterator_base_types.h, include/bits/stl_list.h,
include/bits/stl_map.h, include/bits/stl_multimap.h,
include/bits/stl_multiset.h, include/bits/stl_numeric.h,
include/bits/stl_pair.h, include/bits/stl_pthread_alloc.h,
include/bits/stl_queue.h, include/bits/stl_raw_storage_iter.h,
include/bits/stl_relops.h, include/bits/stl_set.h,
include/bits/stl_stack.h, include/bits/stl_tempbuf.h,
include/bits/stl_threads.h, include/bits/stl_tree.h,
include/bits/stl_uninitialized.h, include/bits/stl_vector.h,
include/bits/stream_iterator.h, include/bits/streambuf_iterator.h,
include/bits/stringfwd.h, include/bits/type_traits.h,
include/bits/valarray_array.h, include/bits/valarray_meta.h:
Add hooks, tweak comments only.
* include/bits/stl_algobase.h (swap, min, iter_swap): Also
document these functions.
* include/bits/stl_function.h: Tweak link comments.
From-SVN: r46717
2001-11-02 18:38:11 +01:00
|
|
|
* This is an internal header file, included by other library headers.
|
2010-12-19 10:21:16 +01:00
|
|
|
* Do not attempt to use it directly. @headername{string}
|
c_io_stdio.h: Correct grammar in comments.
2001-11-02 Phil Edwards <pme@gcc.gnu.org>
* config/io/c_io_stdio.h: Correct grammar in comments.
* docs/doxygen/Intro.3: Expand "top-level" man page.
* docs/doxygen/doxygroups.cc: New module definitions (comments).
* docs/doxygen/mainpage.doxy: Tweaks.
* docs/doxygen/run_doxygen: Update Doxygen version, massage man pages.
Add @file hooks so that headers are considered to be documented.
* include/bits/basic_ios.h, include/bits/basic_file.h,
include/bits/basic_string.h, include/bits/boost_concept_check.h,
include/bits/char_traits.h, include/bits/codecvt.h,
include/bits/concept_check.h, include/bits/cpp_type_traits.h,
include/bits/fpos.h, include/bits/gslice.h, include/bits/gslice_array.h,
include/bits/indirect_array.h, include/bits/ios_base.h,
include/bits/locale_facets.h, include/bits/localefwd.h,
include/bits/mask_array.h, include/bits/pthread_allocimpl.h,
include/bits/slice.h, include/bits/slice_array.h,
include/bits/std_algorithm.h, include/bits/std_bitset.h,
include/bits/std_complex.h, include/bits/std_deque.h,
include/bits/std_fstream.h, include/bits/std_functional.h,
include/bits/std_iomanip.h, include/bits/std_ios.h,
include/bits/std_iosfwd.h, include/bits/std_iostream.h,
include/bits/std_istream.h, include/bits/std_iterator.h,
include/bits/std_limits.h, include/bits/std_list.h,
include/bits/std_locale.h, include/bits/std_map.h,
include/bits/std_memory.h, include/bits/std_numeric.h,
include/bits/std_ostream.h, include/bits/std_queue.h,
include/bits/std_set.h, include/bits/std_sstream.h,
include/bits/std_stack.h, include/bits/std_streambuf.h,
include/bits/std_string.h, include/bits/std_utility.h,
include/bits/std_valarray.h, include/bits/std_vector.h,
include/bits/stl_algo.h, include/bits/stl_alloc.h,
include/bits/stl_bvector.h, include/bits/stl_construct.h,
include/bits/stl_deque.h, include/bits/stl_heap.h,
include/bits/stl_iterator.h, include/bits/stl_iterator_base_funcs.h,
include/bits/stl_iterator_base_types.h, include/bits/stl_list.h,
include/bits/stl_map.h, include/bits/stl_multimap.h,
include/bits/stl_multiset.h, include/bits/stl_numeric.h,
include/bits/stl_pair.h, include/bits/stl_pthread_alloc.h,
include/bits/stl_queue.h, include/bits/stl_raw_storage_iter.h,
include/bits/stl_relops.h, include/bits/stl_set.h,
include/bits/stl_stack.h, include/bits/stl_tempbuf.h,
include/bits/stl_threads.h, include/bits/stl_tree.h,
include/bits/stl_uninitialized.h, include/bits/stl_vector.h,
include/bits/stream_iterator.h, include/bits/streambuf_iterator.h,
include/bits/stringfwd.h, include/bits/type_traits.h,
include/bits/valarray_array.h, include/bits/valarray_meta.h:
Add hooks, tweak comments only.
* include/bits/stl_algobase.h (swap, min, iter_swap): Also
document these functions.
* include/bits/stl_function.h: Tweak link comments.
From-SVN: r46717
2001-11-02 18:38:11 +01:00
|
|
|
*/
|
|
|
|
|
2006-12-06 00:24:07 +01:00
|
|
|
//
|
|
|
|
// ISO C++ 14882: 21 Strings library
|
|
|
|
//
|
|
|
|
|
2003-07-05 06:05:45 +02:00
|
|
|
#ifndef _CHAR_TRAITS_H
|
|
|
|
#define _CHAR_TRAITS_H 1
|
2000-10-05 13:27:02 +02:00
|
|
|
|
2001-02-19 19:52:25 +01:00
|
|
|
#pragma GCC system_header
|
|
|
|
|
2007-11-15 20:05:17 +01:00
|
|
|
#include <bits/stl_algobase.h> // std::copy, std::fill_n
|
2007-03-03 11:29:14 +01:00
|
|
|
#include <bits/postypes.h> // For streampos
|
|
|
|
#include <cwchar> // For WEOF, wmemmove, wmemset, etc.
|
2000-10-05 13:27:02 +02:00
|
|
|
|
PR libstdc++/36104 part four
2011-01-30 Benjamin Kosnik <bkoz@redhat.com>
PR libstdc++/36104 part four
* include/bits/c++config (_GLIBCXX_STD): Remove.
(_GLIBCXX_STD_D, _GLIBCXX_PR): Now _GLIBCXX_STD_C.
(_GLIBCXX_P): Now _GLIBCXX_STD_A.
(_GLIBCXX_NAMESPACE_DEBUG, _GLIBCXX_NAMESPACE_PARALLEL,
_GLIBCXX_NAMESPACE_PROFILE, _GLIBCXX_NAMESPACE_VERSION): Remove.
(_GLIBCXX_INLINE_DEBUG, _GLIBCXX_INLINE_PARALLEL,
_GLIBCXX_INLINE_PROFILE): Remove.
(_GLIBCXX_BEGIN_NAMESPACE(X)): Remove.
(_GLIBCXX_END_NAMESPACE): Remove.
(_GLIBCXX_BEGIN_NESTED_NAMESPACE(X, Y)): Remove.
(_GLIBCXX_END_NESTED_NAMESPACE): Remove.
(_GLIBCXX_BEGIN_NAMESPACE_ALGO): Add.
(_GLIBCXX_END_NAMESPACE_ALGO): Add.
(_GLIBCXX_BEGIN_NAMESPACE_CONTAINER): Add.
(_GLIBCXX_END_NAMESPACE_CONTAINER): Add.
(_GLIBCXX_BEGIN_NAMESPACE_VERSION): Add.
(_GLIBCXX_END_NAMESPACE_VERSION): Add.
(_GLIBCXX_BEGIN_LDBL_NAMESPACE): To _GLIBCXX_BEGIN_NAMESPACE_LDBL.
(_GLIBCXX_END_LDBL_NAMESPACE): To _GLIBCXX_END_NAMESPACE_LDBL.
(_GLIBCXX_VISIBILITY_ATTR): Revert to _GLIBCXX_VISIBILITY.
* include/*: Use new macros for namespace scope.
* config/*: Same.
* src/*: Same.
* src/Makefile.am (sources): Remove debug_list.cc, add
compatibility-debug_list-2.cc.
(parallel_sources): Remove parallel_list.cc, add
compatibility-parallel_list-2.cc.
(compatibility-parallel_list-2.[o,lo]): New rule.
* src/Makefile.in: Regenerate.
* src/debug_list.cc: Remove.
* src/parallel_list.cc: Remove.
* src/compatibility-list-2.cc: New.
* src/compatibility-debug_list-2.cc: New.
* src/compatibility-parallel_list-2.cc: New.
* doc/doxygen/user.cfg.in: Adjust macros.
* testsuite/20_util/auto_ptr/assign_neg.cc: Adjust line numbers, macros.
* testsuite/20_util/declval/requirements/1_neg.cc: Same.
* testsuite/20_util/duration/requirements/typedefs_neg1.cc: Same.
* testsuite/20_util/duration/requirements/typedefs_neg2.cc: Same.
* testsuite/20_util/duration/requirements/typedefs_neg3.cc: Same.
* testsuite/20_util/forward/c_neg.cc: Same.
* testsuite/20_util/forward/f_neg.cc: Same.
* testsuite/20_util/make_signed/requirements/typedefs_neg.cc: Same.
* testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc: Same.
* testsuite/20_util/ratio/cons/cons_overflow_neg.cc: Same.
* testsuite/20_util/ratio/operations/ops_overflow_neg.cc: Same.
* testsuite/20_util/shared_ptr/cons/43820_neg.cc: Same.
* testsuite/20_util/weak_ptr/comparison/cmp_neg.cc: Same.
* testsuite/23_containers/deque/requirements/dr438/assign_neg.cc: Same.
* testsuite/23_containers/deque/requirements/dr438/
constructor_1_neg.cc: Same.
* testsuite/23_containers/deque/requirements/dr438/
constructor_2_neg.cc: Same.
* testsuite/23_containers/deque/requirements/dr438/insert_neg.cc: Same.
* testsuite/23_containers/forward_list/capacity/1.cc: Same.
* testsuite/23_containers/forward_list/requirements/dr438/
assign_neg.cc: Same.
* testsuite/23_containers/forward_list/requirements/dr438/
constructor_1_neg.cc: Same.
* testsuite/23_containers/forward_list/requirements/dr438/
constructor_2_neg.cc: Same.
* testsuite/23_containers/forward_list/requirements/dr438/
insert_neg.cc: Same.
* testsuite/23_containers/list/capacity/29134.cc: Same.
* testsuite/23_containers/list/requirements/dr438/assign_neg.cc: Same.
* testsuite/23_containers/list/requirements/dr438/
constructor_1_neg.cc: Same.
* testsuite/23_containers/list/requirements/dr438/
constructor_2_neg.cc: Same.
* testsuite/23_containers/list/requirements/dr438/insert_neg.cc: Same.
* testsuite/23_containers/vector/bool/capacity/29134.cc: Same.
* testsuite/23_containers/vector/bool/modifiers/insert/31370.cc: Same.
* testsuite/23_containers/vector/requirements/dr438/assign_neg.cc: Same.
* testsuite/23_containers/vector/requirements/dr438/
constructor_1_neg.cc: Same.
* testsuite/23_containers/vector/requirements/dr438/
constructor_2_neg.cc: Same.
* testsuite/23_containers/vector/requirements/dr438/insert_neg.cc: Same.
* testsuite/25_algorithms/sort/35588.cc: Same.
* testsuite/27_io/ios_base/cons/assign_neg.cc: Same.
* testsuite/27_io/ios_base/cons/copy_neg.cc: Same.
* testsuite/ext/profile/mutex_extensions_neg.cc: Same.
* testsuite/ext/profile/profiler_algos.cc: Same.
* testsuite/ext/type_traits/add_unsigned_floating_neg.cc: Same.
* testsuite/ext/type_traits/add_unsigned_integer_neg.cc: Same.
* testsuite/ext/type_traits/remove_unsigned_floating_neg.cc: Same.
* testsuite/ext/type_traits/remove_unsigned_integer_neg.cc: Same.
* testsuite/tr1/2_general_utilities/shared_ptr/cons/43820_neg.cc: Same.
From-SVN: r169421
2011-01-30 23:39:36 +01:00
|
|
|
namespace __gnu_cxx _GLIBCXX_VISIBILITY(default)
|
|
|
|
{
|
|
|
|
_GLIBCXX_BEGIN_NAMESPACE_VERSION
|
2005-12-19 01:56:05 +01:00
|
|
|
|
abi.txt: New file.
2002-07-20 Phil Edwards <pme@gcc.gnu.org>
* docs/html/abi.txt: New file.
* docs/html/23_containers/howto.html: Tweak vector-overhead text.
* docs/html/ext/lwg-active.html, docs/html/ext/lwg-defects.html:
Import from upstream, R22.
* include/bits/char_traits.h, include/bits/stl_iterator.h,
include/bits/stl_iterator_base_types.h, libsupc++/exception,
libsupc++/new, libsupc++/typeinfo: Use @brief markup.
* include/bits/deque.tcc, include/bits/stl_alloc.h,
include/bits/stl_deque.h, include/bits/stl_list.h: Postpone removal
of deprecated functions until 3.4. (Same timeframe, different text.)
* include/bits/stl_vector.h: Ditto. Also do the same cleanups that
the other sequence classes received.
From-SVN: r55602
2002-07-20 08:26:27 +02:00
|
|
|
/**
|
2003-07-25 07:32:23 +02:00
|
|
|
* @brief Mapping from character type to associated types.
|
2004-02-08 05:46:42 +01:00
|
|
|
*
|
2003-07-25 07:32:23 +02:00
|
|
|
* @note This is an implementation class for the generic version
|
|
|
|
* of char_traits. It defines int_type, off_type, pos_type, and
|
|
|
|
* state_type. By default these are unsigned long, streamoff,
|
2004-02-08 05:46:42 +01:00
|
|
|
* streampos, and mbstate_t. Users who need a different set of
|
2003-07-25 07:32:23 +02:00
|
|
|
* types, but who don't need to change the definitions of any function
|
|
|
|
* defined in char_traits, can specialize __gnu_cxx::_Char_types
|
|
|
|
* while leaving __gnu_cxx::char_traits alone. */
|
2007-08-22 03:26:43 +02:00
|
|
|
template<typename _CharT>
|
2003-07-25 07:32:23 +02:00
|
|
|
struct _Char_types
|
|
|
|
{
|
|
|
|
typedef unsigned long int_type;
|
|
|
|
typedef std::streampos pos_type;
|
|
|
|
typedef std::streamoff off_type;
|
|
|
|
typedef std::mbstate_t state_type;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Base class used to implement std::char_traits.
|
|
|
|
*
|
|
|
|
* @note For any given actual character type, this definition is
|
|
|
|
* probably wrong. (Most of the member functions are likely to be
|
|
|
|
* right, but the int_type and state_type typedefs, and the eof()
|
|
|
|
* member function, are likely to be wrong.) The reason this class
|
|
|
|
* exists is so users can specialize it. Classes in namespace std
|
2008-01-31 19:44:55 +01:00
|
|
|
* may not be specialized for fundamental types, but classes in
|
2003-07-25 07:32:23 +02:00
|
|
|
* namespace __gnu_cxx may be.
|
2002-09-01 02:33:53 +02:00
|
|
|
*
|
2008-12-02 05:55:54 +01:00
|
|
|
* See http://gcc.gnu.org/onlinedocs/libstdc++/manual/bk01pt05ch13s03.html
|
2010-02-04 19:20:34 +01:00
|
|
|
* for advice on how to make use of this class for @a unusual character
|
2004-11-05 20:58:03 +01:00
|
|
|
* types. Also, check out include/ext/pod_char_traits.h.
|
|
|
|
*/
|
2003-07-25 07:32:23 +02:00
|
|
|
template<typename _CharT>
|
2000-10-05 13:27:02 +02:00
|
|
|
struct char_traits
|
|
|
|
{
|
2003-07-25 07:32:23 +02:00
|
|
|
typedef _CharT char_type;
|
|
|
|
typedef typename _Char_types<_CharT>::int_type int_type;
|
|
|
|
typedef typename _Char_types<_CharT>::pos_type pos_type;
|
|
|
|
typedef typename _Char_types<_CharT>::off_type off_type;
|
|
|
|
typedef typename _Char_types<_CharT>::state_type state_type;
|
2004-02-08 05:46:42 +01:00
|
|
|
|
|
|
|
static void
|
2003-07-25 07:32:23 +02:00
|
|
|
assign(char_type& __c1, const char_type& __c2)
|
|
|
|
{ __c1 = __c2; }
|
2000-10-05 13:27:02 +02:00
|
|
|
|
2010-11-02 03:35:28 +01:00
|
|
|
static _GLIBCXX_CONSTEXPR bool
|
2003-07-25 07:32:23 +02:00
|
|
|
eq(const char_type& __c1, const char_type& __c2)
|
|
|
|
{ return __c1 == __c2; }
|
2000-10-05 13:27:02 +02:00
|
|
|
|
2010-11-02 03:35:28 +01:00
|
|
|
static _GLIBCXX_CONSTEXPR bool
|
2003-07-25 07:32:23 +02:00
|
|
|
lt(const char_type& __c1, const char_type& __c2)
|
|
|
|
{ return __c1 < __c2; }
|
2000-10-05 13:27:02 +02:00
|
|
|
|
2004-02-08 05:46:42 +01:00
|
|
|
static int
|
2003-07-25 07:32:23 +02:00
|
|
|
compare(const char_type* __s1, const char_type* __s2, std::size_t __n);
|
2000-10-05 13:27:02 +02:00
|
|
|
|
2003-07-25 07:32:23 +02:00
|
|
|
static std::size_t
|
2002-07-31 04:47:36 +02:00
|
|
|
length(const char_type* __s);
|
2000-10-05 13:27:02 +02:00
|
|
|
|
2004-02-08 05:46:42 +01:00
|
|
|
static const char_type*
|
2003-07-25 07:32:23 +02:00
|
|
|
find(const char_type* __s, std::size_t __n, const char_type& __a);
|
2000-10-05 13:27:02 +02:00
|
|
|
|
2004-02-08 05:46:42 +01:00
|
|
|
static char_type*
|
2003-07-25 07:32:23 +02:00
|
|
|
move(char_type* __s1, const char_type* __s2, std::size_t __n);
|
2000-10-05 13:27:02 +02:00
|
|
|
|
2004-02-08 05:46:42 +01:00
|
|
|
static char_type*
|
2003-07-25 07:32:23 +02:00
|
|
|
copy(char_type* __s1, const char_type* __s2, std::size_t __n);
|
2000-10-05 13:27:02 +02:00
|
|
|
|
2004-02-08 05:46:42 +01:00
|
|
|
static char_type*
|
2003-07-25 07:32:23 +02:00
|
|
|
assign(char_type* __s, std::size_t __n, char_type __a);
|
2000-10-05 13:27:02 +02:00
|
|
|
|
2010-11-02 03:35:28 +01:00
|
|
|
static _GLIBCXX_CONSTEXPR char_type
|
2003-07-25 07:32:23 +02:00
|
|
|
to_char_type(const int_type& __c)
|
|
|
|
{ return static_cast<char_type>(__c); }
|
2000-10-05 13:27:02 +02:00
|
|
|
|
2010-11-02 03:35:28 +01:00
|
|
|
static _GLIBCXX_CONSTEXPR int_type
|
2003-07-25 07:32:23 +02:00
|
|
|
to_int_type(const char_type& __c)
|
|
|
|
{ return static_cast<int_type>(__c); }
|
2000-10-05 13:27:02 +02:00
|
|
|
|
2010-11-02 03:35:28 +01:00
|
|
|
static _GLIBCXX_CONSTEXPR bool
|
2003-07-25 07:32:23 +02:00
|
|
|
eq_int_type(const int_type& __c1, const int_type& __c2)
|
|
|
|
{ return __c1 == __c2; }
|
2000-10-05 13:27:02 +02:00
|
|
|
|
2010-11-02 03:35:28 +01:00
|
|
|
static _GLIBCXX_CONSTEXPR int_type
|
2003-07-25 07:32:23 +02:00
|
|
|
eof()
|
2010-07-27 12:36:50 +02:00
|
|
|
{ return static_cast<int_type>(_GLIBCXX_STDIO_EOF); }
|
2000-10-05 13:27:02 +02:00
|
|
|
|
2010-11-02 03:35:28 +01:00
|
|
|
static _GLIBCXX_CONSTEXPR int_type
|
2003-07-25 07:32:23 +02:00
|
|
|
not_eof(const int_type& __c)
|
2003-08-08 01:01:26 +02:00
|
|
|
{ return !eq_int_type(__c, eof()) ? __c : to_int_type(char_type()); }
|
2000-10-05 13:27:02 +02:00
|
|
|
};
|
|
|
|
|
2003-07-25 07:32:23 +02:00
|
|
|
template<typename _CharT>
|
|
|
|
int
|
|
|
|
char_traits<_CharT>::
|
|
|
|
compare(const char_type* __s1, const char_type* __s2, std::size_t __n)
|
|
|
|
{
|
2006-04-23 16:54:26 +02:00
|
|
|
for (std::size_t __i = 0; __i < __n; ++__i)
|
2003-07-25 07:32:23 +02:00
|
|
|
if (lt(__s1[__i], __s2[__i]))
|
|
|
|
return -1;
|
|
|
|
else if (lt(__s2[__i], __s1[__i]))
|
|
|
|
return 1;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
template<typename _CharT>
|
|
|
|
std::size_t
|
|
|
|
char_traits<_CharT>::
|
|
|
|
length(const char_type* __p)
|
|
|
|
{
|
|
|
|
std::size_t __i = 0;
|
|
|
|
while (!eq(__p[__i], char_type()))
|
|
|
|
++__i;
|
|
|
|
return __i;
|
|
|
|
}
|
|
|
|
|
|
|
|
template<typename _CharT>
|
2004-02-08 05:46:42 +01:00
|
|
|
const typename char_traits<_CharT>::char_type*
|
2003-07-25 07:32:23 +02:00
|
|
|
char_traits<_CharT>::
|
|
|
|
find(const char_type* __s, std::size_t __n, const char_type& __a)
|
|
|
|
{
|
|
|
|
for (std::size_t __i = 0; __i < __n; ++__i)
|
|
|
|
if (eq(__s[__i], __a))
|
|
|
|
return __s + __i;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
template<typename _CharT>
|
|
|
|
typename char_traits<_CharT>::char_type*
|
|
|
|
char_traits<_CharT>::
|
|
|
|
move(char_type* __s1, const char_type* __s2, std::size_t __n)
|
|
|
|
{
|
2007-05-11 20:58:08 +02:00
|
|
|
return static_cast<_CharT*>(__builtin_memmove(__s1, __s2,
|
|
|
|
__n * sizeof(char_type)));
|
2003-07-25 07:32:23 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
template<typename _CharT>
|
2004-02-08 05:46:42 +01:00
|
|
|
typename char_traits<_CharT>::char_type*
|
2003-07-25 07:32:23 +02:00
|
|
|
char_traits<_CharT>::
|
|
|
|
copy(char_type* __s1, const char_type* __s2, std::size_t __n)
|
|
|
|
{
|
2007-09-12 00:32:51 +02:00
|
|
|
// NB: Inline std::copy so no recursive dependencies.
|
2003-07-25 07:32:23 +02:00
|
|
|
std::copy(__s2, __s2 + __n, __s1);
|
|
|
|
return __s1;
|
|
|
|
}
|
|
|
|
|
|
|
|
template<typename _CharT>
|
2004-02-08 05:46:42 +01:00
|
|
|
typename char_traits<_CharT>::char_type*
|
2003-07-25 07:32:23 +02:00
|
|
|
char_traits<_CharT>::
|
|
|
|
assign(char_type* __s, std::size_t __n, char_type __a)
|
|
|
|
{
|
2007-09-12 00:32:51 +02:00
|
|
|
// NB: Inline std::fill_n so no recursive dependencies.
|
2003-07-25 07:32:23 +02:00
|
|
|
std::fill_n(__s, __n, __a);
|
|
|
|
return __s;
|
|
|
|
}
|
|
|
|
|
PR libstdc++/36104 part four
2011-01-30 Benjamin Kosnik <bkoz@redhat.com>
PR libstdc++/36104 part four
* include/bits/c++config (_GLIBCXX_STD): Remove.
(_GLIBCXX_STD_D, _GLIBCXX_PR): Now _GLIBCXX_STD_C.
(_GLIBCXX_P): Now _GLIBCXX_STD_A.
(_GLIBCXX_NAMESPACE_DEBUG, _GLIBCXX_NAMESPACE_PARALLEL,
_GLIBCXX_NAMESPACE_PROFILE, _GLIBCXX_NAMESPACE_VERSION): Remove.
(_GLIBCXX_INLINE_DEBUG, _GLIBCXX_INLINE_PARALLEL,
_GLIBCXX_INLINE_PROFILE): Remove.
(_GLIBCXX_BEGIN_NAMESPACE(X)): Remove.
(_GLIBCXX_END_NAMESPACE): Remove.
(_GLIBCXX_BEGIN_NESTED_NAMESPACE(X, Y)): Remove.
(_GLIBCXX_END_NESTED_NAMESPACE): Remove.
(_GLIBCXX_BEGIN_NAMESPACE_ALGO): Add.
(_GLIBCXX_END_NAMESPACE_ALGO): Add.
(_GLIBCXX_BEGIN_NAMESPACE_CONTAINER): Add.
(_GLIBCXX_END_NAMESPACE_CONTAINER): Add.
(_GLIBCXX_BEGIN_NAMESPACE_VERSION): Add.
(_GLIBCXX_END_NAMESPACE_VERSION): Add.
(_GLIBCXX_BEGIN_LDBL_NAMESPACE): To _GLIBCXX_BEGIN_NAMESPACE_LDBL.
(_GLIBCXX_END_LDBL_NAMESPACE): To _GLIBCXX_END_NAMESPACE_LDBL.
(_GLIBCXX_VISIBILITY_ATTR): Revert to _GLIBCXX_VISIBILITY.
* include/*: Use new macros for namespace scope.
* config/*: Same.
* src/*: Same.
* src/Makefile.am (sources): Remove debug_list.cc, add
compatibility-debug_list-2.cc.
(parallel_sources): Remove parallel_list.cc, add
compatibility-parallel_list-2.cc.
(compatibility-parallel_list-2.[o,lo]): New rule.
* src/Makefile.in: Regenerate.
* src/debug_list.cc: Remove.
* src/parallel_list.cc: Remove.
* src/compatibility-list-2.cc: New.
* src/compatibility-debug_list-2.cc: New.
* src/compatibility-parallel_list-2.cc: New.
* doc/doxygen/user.cfg.in: Adjust macros.
* testsuite/20_util/auto_ptr/assign_neg.cc: Adjust line numbers, macros.
* testsuite/20_util/declval/requirements/1_neg.cc: Same.
* testsuite/20_util/duration/requirements/typedefs_neg1.cc: Same.
* testsuite/20_util/duration/requirements/typedefs_neg2.cc: Same.
* testsuite/20_util/duration/requirements/typedefs_neg3.cc: Same.
* testsuite/20_util/forward/c_neg.cc: Same.
* testsuite/20_util/forward/f_neg.cc: Same.
* testsuite/20_util/make_signed/requirements/typedefs_neg.cc: Same.
* testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc: Same.
* testsuite/20_util/ratio/cons/cons_overflow_neg.cc: Same.
* testsuite/20_util/ratio/operations/ops_overflow_neg.cc: Same.
* testsuite/20_util/shared_ptr/cons/43820_neg.cc: Same.
* testsuite/20_util/weak_ptr/comparison/cmp_neg.cc: Same.
* testsuite/23_containers/deque/requirements/dr438/assign_neg.cc: Same.
* testsuite/23_containers/deque/requirements/dr438/
constructor_1_neg.cc: Same.
* testsuite/23_containers/deque/requirements/dr438/
constructor_2_neg.cc: Same.
* testsuite/23_containers/deque/requirements/dr438/insert_neg.cc: Same.
* testsuite/23_containers/forward_list/capacity/1.cc: Same.
* testsuite/23_containers/forward_list/requirements/dr438/
assign_neg.cc: Same.
* testsuite/23_containers/forward_list/requirements/dr438/
constructor_1_neg.cc: Same.
* testsuite/23_containers/forward_list/requirements/dr438/
constructor_2_neg.cc: Same.
* testsuite/23_containers/forward_list/requirements/dr438/
insert_neg.cc: Same.
* testsuite/23_containers/list/capacity/29134.cc: Same.
* testsuite/23_containers/list/requirements/dr438/assign_neg.cc: Same.
* testsuite/23_containers/list/requirements/dr438/
constructor_1_neg.cc: Same.
* testsuite/23_containers/list/requirements/dr438/
constructor_2_neg.cc: Same.
* testsuite/23_containers/list/requirements/dr438/insert_neg.cc: Same.
* testsuite/23_containers/vector/bool/capacity/29134.cc: Same.
* testsuite/23_containers/vector/bool/modifiers/insert/31370.cc: Same.
* testsuite/23_containers/vector/requirements/dr438/assign_neg.cc: Same.
* testsuite/23_containers/vector/requirements/dr438/
constructor_1_neg.cc: Same.
* testsuite/23_containers/vector/requirements/dr438/
constructor_2_neg.cc: Same.
* testsuite/23_containers/vector/requirements/dr438/insert_neg.cc: Same.
* testsuite/25_algorithms/sort/35588.cc: Same.
* testsuite/27_io/ios_base/cons/assign_neg.cc: Same.
* testsuite/27_io/ios_base/cons/copy_neg.cc: Same.
* testsuite/ext/profile/mutex_extensions_neg.cc: Same.
* testsuite/ext/profile/profiler_algos.cc: Same.
* testsuite/ext/type_traits/add_unsigned_floating_neg.cc: Same.
* testsuite/ext/type_traits/add_unsigned_integer_neg.cc: Same.
* testsuite/ext/type_traits/remove_unsigned_floating_neg.cc: Same.
* testsuite/ext/type_traits/remove_unsigned_integer_neg.cc: Same.
* testsuite/tr1/2_general_utilities/shared_ptr/cons/43820_neg.cc: Same.
From-SVN: r169421
2011-01-30 23:39:36 +01:00
|
|
|
_GLIBCXX_END_NAMESPACE_VERSION
|
|
|
|
} // namespace
|
2005-12-19 01:56:05 +01:00
|
|
|
|
PR libstdc++/36104 part four
2011-01-30 Benjamin Kosnik <bkoz@redhat.com>
PR libstdc++/36104 part four
* include/bits/c++config (_GLIBCXX_STD): Remove.
(_GLIBCXX_STD_D, _GLIBCXX_PR): Now _GLIBCXX_STD_C.
(_GLIBCXX_P): Now _GLIBCXX_STD_A.
(_GLIBCXX_NAMESPACE_DEBUG, _GLIBCXX_NAMESPACE_PARALLEL,
_GLIBCXX_NAMESPACE_PROFILE, _GLIBCXX_NAMESPACE_VERSION): Remove.
(_GLIBCXX_INLINE_DEBUG, _GLIBCXX_INLINE_PARALLEL,
_GLIBCXX_INLINE_PROFILE): Remove.
(_GLIBCXX_BEGIN_NAMESPACE(X)): Remove.
(_GLIBCXX_END_NAMESPACE): Remove.
(_GLIBCXX_BEGIN_NESTED_NAMESPACE(X, Y)): Remove.
(_GLIBCXX_END_NESTED_NAMESPACE): Remove.
(_GLIBCXX_BEGIN_NAMESPACE_ALGO): Add.
(_GLIBCXX_END_NAMESPACE_ALGO): Add.
(_GLIBCXX_BEGIN_NAMESPACE_CONTAINER): Add.
(_GLIBCXX_END_NAMESPACE_CONTAINER): Add.
(_GLIBCXX_BEGIN_NAMESPACE_VERSION): Add.
(_GLIBCXX_END_NAMESPACE_VERSION): Add.
(_GLIBCXX_BEGIN_LDBL_NAMESPACE): To _GLIBCXX_BEGIN_NAMESPACE_LDBL.
(_GLIBCXX_END_LDBL_NAMESPACE): To _GLIBCXX_END_NAMESPACE_LDBL.
(_GLIBCXX_VISIBILITY_ATTR): Revert to _GLIBCXX_VISIBILITY.
* include/*: Use new macros for namespace scope.
* config/*: Same.
* src/*: Same.
* src/Makefile.am (sources): Remove debug_list.cc, add
compatibility-debug_list-2.cc.
(parallel_sources): Remove parallel_list.cc, add
compatibility-parallel_list-2.cc.
(compatibility-parallel_list-2.[o,lo]): New rule.
* src/Makefile.in: Regenerate.
* src/debug_list.cc: Remove.
* src/parallel_list.cc: Remove.
* src/compatibility-list-2.cc: New.
* src/compatibility-debug_list-2.cc: New.
* src/compatibility-parallel_list-2.cc: New.
* doc/doxygen/user.cfg.in: Adjust macros.
* testsuite/20_util/auto_ptr/assign_neg.cc: Adjust line numbers, macros.
* testsuite/20_util/declval/requirements/1_neg.cc: Same.
* testsuite/20_util/duration/requirements/typedefs_neg1.cc: Same.
* testsuite/20_util/duration/requirements/typedefs_neg2.cc: Same.
* testsuite/20_util/duration/requirements/typedefs_neg3.cc: Same.
* testsuite/20_util/forward/c_neg.cc: Same.
* testsuite/20_util/forward/f_neg.cc: Same.
* testsuite/20_util/make_signed/requirements/typedefs_neg.cc: Same.
* testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc: Same.
* testsuite/20_util/ratio/cons/cons_overflow_neg.cc: Same.
* testsuite/20_util/ratio/operations/ops_overflow_neg.cc: Same.
* testsuite/20_util/shared_ptr/cons/43820_neg.cc: Same.
* testsuite/20_util/weak_ptr/comparison/cmp_neg.cc: Same.
* testsuite/23_containers/deque/requirements/dr438/assign_neg.cc: Same.
* testsuite/23_containers/deque/requirements/dr438/
constructor_1_neg.cc: Same.
* testsuite/23_containers/deque/requirements/dr438/
constructor_2_neg.cc: Same.
* testsuite/23_containers/deque/requirements/dr438/insert_neg.cc: Same.
* testsuite/23_containers/forward_list/capacity/1.cc: Same.
* testsuite/23_containers/forward_list/requirements/dr438/
assign_neg.cc: Same.
* testsuite/23_containers/forward_list/requirements/dr438/
constructor_1_neg.cc: Same.
* testsuite/23_containers/forward_list/requirements/dr438/
constructor_2_neg.cc: Same.
* testsuite/23_containers/forward_list/requirements/dr438/
insert_neg.cc: Same.
* testsuite/23_containers/list/capacity/29134.cc: Same.
* testsuite/23_containers/list/requirements/dr438/assign_neg.cc: Same.
* testsuite/23_containers/list/requirements/dr438/
constructor_1_neg.cc: Same.
* testsuite/23_containers/list/requirements/dr438/
constructor_2_neg.cc: Same.
* testsuite/23_containers/list/requirements/dr438/insert_neg.cc: Same.
* testsuite/23_containers/vector/bool/capacity/29134.cc: Same.
* testsuite/23_containers/vector/bool/modifiers/insert/31370.cc: Same.
* testsuite/23_containers/vector/requirements/dr438/assign_neg.cc: Same.
* testsuite/23_containers/vector/requirements/dr438/
constructor_1_neg.cc: Same.
* testsuite/23_containers/vector/requirements/dr438/
constructor_2_neg.cc: Same.
* testsuite/23_containers/vector/requirements/dr438/insert_neg.cc: Same.
* testsuite/25_algorithms/sort/35588.cc: Same.
* testsuite/27_io/ios_base/cons/assign_neg.cc: Same.
* testsuite/27_io/ios_base/cons/copy_neg.cc: Same.
* testsuite/ext/profile/mutex_extensions_neg.cc: Same.
* testsuite/ext/profile/profiler_algos.cc: Same.
* testsuite/ext/type_traits/add_unsigned_floating_neg.cc: Same.
* testsuite/ext/type_traits/add_unsigned_integer_neg.cc: Same.
* testsuite/ext/type_traits/remove_unsigned_floating_neg.cc: Same.
* testsuite/ext/type_traits/remove_unsigned_integer_neg.cc: Same.
* testsuite/tr1/2_general_utilities/shared_ptr/cons/43820_neg.cc: Same.
From-SVN: r169421
2011-01-30 23:39:36 +01:00
|
|
|
namespace std _GLIBCXX_VISIBILITY(default)
|
|
|
|
{
|
|
|
|
_GLIBCXX_BEGIN_NAMESPACE_VERSION
|
2005-12-19 01:56:05 +01:00
|
|
|
|
2003-07-25 07:32:23 +02:00
|
|
|
// 21.1
|
|
|
|
/**
|
|
|
|
* @brief Basis for explicit traits specializations.
|
|
|
|
*
|
|
|
|
* @note For any given actual character type, this definition is
|
|
|
|
* probably wrong. Since this is just a thin wrapper around
|
|
|
|
* __gnu_cxx::char_traits, it is possible to achieve a more
|
|
|
|
* appropriate definition by specializing __gnu_cxx::char_traits.
|
|
|
|
*
|
2008-12-02 05:55:54 +01:00
|
|
|
* See http://gcc.gnu.org/onlinedocs/libstdc++/manual/bk01pt05ch13s03.html
|
2010-02-04 19:20:34 +01:00
|
|
|
* for advice on how to make use of this class for @a unusual character
|
2003-07-25 07:32:23 +02:00
|
|
|
* types. Also, check out include/ext/pod_char_traits.h.
|
|
|
|
*/
|
|
|
|
template<class _CharT>
|
2004-11-05 20:58:03 +01:00
|
|
|
struct char_traits : public __gnu_cxx::char_traits<_CharT>
|
2003-07-25 07:32:23 +02:00
|
|
|
{ };
|
|
|
|
|
2001-01-12 22:24:15 +01:00
|
|
|
|
2008-03-26 07:27:35 +01:00
|
|
|
/// 21.1.3.1 char_traits specializations
|
2000-10-05 13:27:02 +02:00
|
|
|
template<>
|
|
|
|
struct char_traits<char>
|
|
|
|
{
|
2003-07-25 07:32:23 +02:00
|
|
|
typedef char char_type;
|
|
|
|
typedef int int_type;
|
|
|
|
typedef streampos pos_type;
|
|
|
|
typedef streamoff off_type;
|
|
|
|
typedef mbstate_t state_type;
|
2000-10-05 13:27:02 +02:00
|
|
|
|
2004-02-08 05:46:42 +01:00
|
|
|
static void
|
2000-10-05 13:27:02 +02:00
|
|
|
assign(char_type& __c1, const char_type& __c2)
|
|
|
|
{ __c1 = __c2; }
|
|
|
|
|
2010-11-02 03:35:28 +01:00
|
|
|
static _GLIBCXX_CONSTEXPR bool
|
2000-10-05 13:27:02 +02:00
|
|
|
eq(const char_type& __c1, const char_type& __c2)
|
re PR libstdc++/22109 (/home/dave/opt/gnu/bin/ld: BFD 2.16.91 20050612 internal error)
PR libstdc++/22109
* src/compatibility.cc (_GLIBCXX_SYMVER_COMPATIBILITY): Remove.
(istreambuf_iterator, basic_fstream, basic_ifstream, basic_ofstream,
_M_copy, _M_move, _M_assign, _M_disjunct, _M_check_length,
_M_set_length_and_sharable, ignore, eq): Define to XX suffixed
variants.
(ignore (streamsize)): Remove _W prefixed aliases.
(_GLIBCXX_3_4_SYMVER_SPECIAL, _GLIBCXX_3_4_5_SYMVER_SPECIAL,
_GLIBCXX_APPLY_SYMVER_SPECIAL): Remove.
(_GLIBCXX_3_4_SYMVER, _GLIBCXX_3_4_5_SYMVER): Add XXname argument.
Use #XXname instead of #name as the alias argument.
* config/abi/compatibility.h: Replace uses of
_GLIBCXX_APPLY_SYMVER_SPECIAL with _GLIBCXX_APPLY_SYMVER. Always
pass 2 arguments to the _GLIBCXX_APPLY_SYMVER macro.
* include/bits/char_traits.h (char_traits::eq): Revert 2005-06-15
change.
* acinclude.m4: Decrease glibcxx_min_gnu_ld_version back to 21400.
* configure: Rebuilt.
From-SVN: r101273
2005-06-23 18:49:00 +02:00
|
|
|
{ return __c1 == __c2; }
|
2000-10-05 13:27:02 +02:00
|
|
|
|
2010-11-02 03:35:28 +01:00
|
|
|
static _GLIBCXX_CONSTEXPR bool
|
2000-10-05 13:27:02 +02:00
|
|
|
lt(const char_type& __c1, const char_type& __c2)
|
|
|
|
{ return __c1 < __c2; }
|
|
|
|
|
2004-02-08 05:46:42 +01:00
|
|
|
static int
|
2000-10-05 13:27:02 +02:00
|
|
|
compare(const char_type* __s1, const char_type* __s2, size_t __n)
|
2007-05-11 20:58:08 +02:00
|
|
|
{ return __builtin_memcmp(__s1, __s2, __n); }
|
2000-10-05 13:27:02 +02:00
|
|
|
|
|
|
|
static size_t
|
|
|
|
length(const char_type* __s)
|
2007-05-11 20:58:08 +02:00
|
|
|
{ return __builtin_strlen(__s); }
|
2000-10-05 13:27:02 +02:00
|
|
|
|
2004-02-08 05:46:42 +01:00
|
|
|
static const char_type*
|
2000-10-05 13:27:02 +02:00
|
|
|
find(const char_type* __s, size_t __n, const char_type& __a)
|
2007-05-11 20:58:08 +02:00
|
|
|
{ return static_cast<const char_type*>(__builtin_memchr(__s, __a, __n)); }
|
2000-10-05 13:27:02 +02:00
|
|
|
|
2004-02-08 05:46:42 +01:00
|
|
|
static char_type*
|
2000-10-05 13:27:02 +02:00
|
|
|
move(char_type* __s1, const char_type* __s2, size_t __n)
|
2007-05-11 20:58:08 +02:00
|
|
|
{ return static_cast<char_type*>(__builtin_memmove(__s1, __s2, __n)); }
|
2000-10-05 13:27:02 +02:00
|
|
|
|
2004-02-08 05:46:42 +01:00
|
|
|
static char_type*
|
2000-10-05 13:27:02 +02:00
|
|
|
copy(char_type* __s1, const char_type* __s2, size_t __n)
|
2007-05-11 20:58:08 +02:00
|
|
|
{ return static_cast<char_type*>(__builtin_memcpy(__s1, __s2, __n)); }
|
2000-10-05 13:27:02 +02:00
|
|
|
|
2004-02-08 05:46:42 +01:00
|
|
|
static char_type*
|
2000-10-05 13:27:02 +02:00
|
|
|
assign(char_type* __s, size_t __n, char_type __a)
|
2007-05-11 20:58:08 +02:00
|
|
|
{ return static_cast<char_type*>(__builtin_memset(__s, __a, __n)); }
|
2000-10-05 13:27:02 +02:00
|
|
|
|
2010-11-02 03:35:28 +01:00
|
|
|
static _GLIBCXX_CONSTEXPR char_type
|
2000-10-05 13:27:02 +02:00
|
|
|
to_char_type(const int_type& __c)
|
|
|
|
{ return static_cast<char_type>(__c); }
|
|
|
|
|
|
|
|
// To keep both the byte 0xff and the eof symbol 0xffffffff
|
|
|
|
// from ending up as 0xffffffff.
|
2010-11-02 03:35:28 +01:00
|
|
|
static _GLIBCXX_CONSTEXPR int_type
|
2000-10-05 13:27:02 +02:00
|
|
|
to_int_type(const char_type& __c)
|
|
|
|
{ return static_cast<int_type>(static_cast<unsigned char>(__c)); }
|
|
|
|
|
2010-11-02 03:35:28 +01:00
|
|
|
static _GLIBCXX_CONSTEXPR bool
|
2000-10-05 13:27:02 +02:00
|
|
|
eq_int_type(const int_type& __c1, const int_type& __c2)
|
|
|
|
{ return __c1 == __c2; }
|
|
|
|
|
2010-11-02 03:35:28 +01:00
|
|
|
static _GLIBCXX_CONSTEXPR int_type
|
char_traits.h (char_traits<char16_t>:: assign(char_type*, size_t, char_type), [...]): For now, just open-code.
2008-08-20 Paolo Carlini <paolo.carlini@oracle.com>
* include/bits/char_traits.h (char_traits<char16_t>::
assign(char_type*, size_t, char_type), char_traits<char32_t>::
assign(char_type*, size_t, char_type)): For now, just open-code.
From-SVN: r139367
2008-08-21 03:06:45 +02:00
|
|
|
eof()
|
2010-07-27 12:36:50 +02:00
|
|
|
{ return static_cast<int_type>(_GLIBCXX_STDIO_EOF); }
|
2000-10-05 13:27:02 +02:00
|
|
|
|
2010-11-02 03:35:28 +01:00
|
|
|
static _GLIBCXX_CONSTEXPR int_type
|
2000-10-05 13:27:02 +02:00
|
|
|
not_eof(const int_type& __c)
|
|
|
|
{ return (__c == eof()) ? 0 : __c; }
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2003-07-05 06:05:45 +02:00
|
|
|
#ifdef _GLIBCXX_USE_WCHAR_T
|
2008-03-26 07:27:35 +01:00
|
|
|
/// 21.1.3.2 char_traits specializations
|
2000-10-05 13:27:02 +02:00
|
|
|
template<>
|
|
|
|
struct char_traits<wchar_t>
|
|
|
|
{
|
2003-07-25 07:32:23 +02:00
|
|
|
typedef wchar_t char_type;
|
|
|
|
typedef wint_t int_type;
|
|
|
|
typedef streamoff off_type;
|
|
|
|
typedef wstreampos pos_type;
|
|
|
|
typedef mbstate_t state_type;
|
2004-02-08 05:46:42 +01:00
|
|
|
|
|
|
|
static void
|
2000-10-05 13:27:02 +02:00
|
|
|
assign(char_type& __c1, const char_type& __c2)
|
|
|
|
{ __c1 = __c2; }
|
|
|
|
|
2010-11-02 03:35:28 +01:00
|
|
|
static _GLIBCXX_CONSTEXPR bool
|
re PR libstdc++/22109 (/home/dave/opt/gnu/bin/ld: BFD 2.16.91 20050612 internal error)
PR libstdc++/22109
* src/compatibility.cc (_GLIBCXX_SYMVER_COMPATIBILITY): Remove.
(istreambuf_iterator, basic_fstream, basic_ifstream, basic_ofstream,
_M_copy, _M_move, _M_assign, _M_disjunct, _M_check_length,
_M_set_length_and_sharable, ignore, eq): Define to XX suffixed
variants.
(ignore (streamsize)): Remove _W prefixed aliases.
(_GLIBCXX_3_4_SYMVER_SPECIAL, _GLIBCXX_3_4_5_SYMVER_SPECIAL,
_GLIBCXX_APPLY_SYMVER_SPECIAL): Remove.
(_GLIBCXX_3_4_SYMVER, _GLIBCXX_3_4_5_SYMVER): Add XXname argument.
Use #XXname instead of #name as the alias argument.
* config/abi/compatibility.h: Replace uses of
_GLIBCXX_APPLY_SYMVER_SPECIAL with _GLIBCXX_APPLY_SYMVER. Always
pass 2 arguments to the _GLIBCXX_APPLY_SYMVER macro.
* include/bits/char_traits.h (char_traits::eq): Revert 2005-06-15
change.
* acinclude.m4: Decrease glibcxx_min_gnu_ld_version back to 21400.
* configure: Rebuilt.
From-SVN: r101273
2005-06-23 18:49:00 +02:00
|
|
|
eq(const char_type& __c1, const char_type& __c2)
|
|
|
|
{ return __c1 == __c2; }
|
2000-10-05 13:27:02 +02:00
|
|
|
|
2010-11-02 03:35:28 +01:00
|
|
|
static _GLIBCXX_CONSTEXPR bool
|
2000-10-05 13:27:02 +02:00
|
|
|
lt(const char_type& __c1, const char_type& __c2)
|
|
|
|
{ return __c1 < __c2; }
|
|
|
|
|
2004-02-08 05:46:42 +01:00
|
|
|
static int
|
2000-10-05 13:27:02 +02:00
|
|
|
compare(const char_type* __s1, const char_type* __s2, size_t __n)
|
|
|
|
{ return wmemcmp(__s1, __s2, __n); }
|
|
|
|
|
|
|
|
static size_t
|
|
|
|
length(const char_type* __s)
|
|
|
|
{ return wcslen(__s); }
|
|
|
|
|
2004-02-08 05:46:42 +01:00
|
|
|
static const char_type*
|
2000-10-05 13:27:02 +02:00
|
|
|
find(const char_type* __s, size_t __n, const char_type& __a)
|
|
|
|
{ return wmemchr(__s, __a, __n); }
|
|
|
|
|
2004-02-08 05:46:42 +01:00
|
|
|
static char_type*
|
2003-07-15 19:30:10 +02:00
|
|
|
move(char_type* __s1, const char_type* __s2, size_t __n)
|
2000-10-05 13:27:02 +02:00
|
|
|
{ return wmemmove(__s1, __s2, __n); }
|
|
|
|
|
2004-02-08 05:46:42 +01:00
|
|
|
static char_type*
|
2000-10-05 13:27:02 +02:00
|
|
|
copy(char_type* __s1, const char_type* __s2, size_t __n)
|
|
|
|
{ return wmemcpy(__s1, __s2, __n); }
|
|
|
|
|
2004-02-08 05:46:42 +01:00
|
|
|
static char_type*
|
2000-10-05 13:27:02 +02:00
|
|
|
assign(char_type* __s, size_t __n, char_type __a)
|
|
|
|
{ return wmemset(__s, __a, __n); }
|
|
|
|
|
2010-11-02 03:35:28 +01:00
|
|
|
static _GLIBCXX_CONSTEXPR char_type
|
char_traits.h (char_traits<char16_t>:: assign(char_type*, size_t, char_type), [...]): For now, just open-code.
2008-08-20 Paolo Carlini <paolo.carlini@oracle.com>
* include/bits/char_traits.h (char_traits<char16_t>::
assign(char_type*, size_t, char_type), char_traits<char32_t>::
assign(char_type*, size_t, char_type)): For now, just open-code.
From-SVN: r139367
2008-08-21 03:06:45 +02:00
|
|
|
to_char_type(const int_type& __c)
|
|
|
|
{ return char_type(__c); }
|
2000-10-05 13:27:02 +02:00
|
|
|
|
2010-11-02 03:35:28 +01:00
|
|
|
static _GLIBCXX_CONSTEXPR int_type
|
char_traits.h (char_traits<char16_t>:: assign(char_type*, size_t, char_type), [...]): For now, just open-code.
2008-08-20 Paolo Carlini <paolo.carlini@oracle.com>
* include/bits/char_traits.h (char_traits<char16_t>::
assign(char_type*, size_t, char_type), char_traits<char32_t>::
assign(char_type*, size_t, char_type)): For now, just open-code.
From-SVN: r139367
2008-08-21 03:06:45 +02:00
|
|
|
to_int_type(const char_type& __c)
|
|
|
|
{ return int_type(__c); }
|
2000-10-05 13:27:02 +02:00
|
|
|
|
2010-11-02 03:35:28 +01:00
|
|
|
static _GLIBCXX_CONSTEXPR bool
|
2000-10-05 13:27:02 +02:00
|
|
|
eq_int_type(const int_type& __c1, const int_type& __c2)
|
|
|
|
{ return __c1 == __c2; }
|
|
|
|
|
2010-11-02 03:35:28 +01:00
|
|
|
static _GLIBCXX_CONSTEXPR int_type
|
char_traits.h (char_traits<char16_t>:: assign(char_type*, size_t, char_type), [...]): For now, just open-code.
2008-08-20 Paolo Carlini <paolo.carlini@oracle.com>
* include/bits/char_traits.h (char_traits<char16_t>::
assign(char_type*, size_t, char_type), char_traits<char32_t>::
assign(char_type*, size_t, char_type)): For now, just open-code.
From-SVN: r139367
2008-08-21 03:06:45 +02:00
|
|
|
eof()
|
|
|
|
{ return static_cast<int_type>(WEOF); }
|
2000-10-05 13:27:02 +02:00
|
|
|
|
2010-11-02 03:35:28 +01:00
|
|
|
static _GLIBCXX_CONSTEXPR int_type
|
2000-10-05 13:27:02 +02:00
|
|
|
not_eof(const int_type& __c)
|
|
|
|
{ return eq_int_type(__c, eof()) ? 0 : __c; }
|
|
|
|
};
|
2003-07-05 06:05:45 +02:00
|
|
|
#endif //_GLIBCXX_USE_WCHAR_T
|
2000-10-05 13:27:02 +02:00
|
|
|
|
PR libstdc++/36104 part four
2011-01-30 Benjamin Kosnik <bkoz@redhat.com>
PR libstdc++/36104 part four
* include/bits/c++config (_GLIBCXX_STD): Remove.
(_GLIBCXX_STD_D, _GLIBCXX_PR): Now _GLIBCXX_STD_C.
(_GLIBCXX_P): Now _GLIBCXX_STD_A.
(_GLIBCXX_NAMESPACE_DEBUG, _GLIBCXX_NAMESPACE_PARALLEL,
_GLIBCXX_NAMESPACE_PROFILE, _GLIBCXX_NAMESPACE_VERSION): Remove.
(_GLIBCXX_INLINE_DEBUG, _GLIBCXX_INLINE_PARALLEL,
_GLIBCXX_INLINE_PROFILE): Remove.
(_GLIBCXX_BEGIN_NAMESPACE(X)): Remove.
(_GLIBCXX_END_NAMESPACE): Remove.
(_GLIBCXX_BEGIN_NESTED_NAMESPACE(X, Y)): Remove.
(_GLIBCXX_END_NESTED_NAMESPACE): Remove.
(_GLIBCXX_BEGIN_NAMESPACE_ALGO): Add.
(_GLIBCXX_END_NAMESPACE_ALGO): Add.
(_GLIBCXX_BEGIN_NAMESPACE_CONTAINER): Add.
(_GLIBCXX_END_NAMESPACE_CONTAINER): Add.
(_GLIBCXX_BEGIN_NAMESPACE_VERSION): Add.
(_GLIBCXX_END_NAMESPACE_VERSION): Add.
(_GLIBCXX_BEGIN_LDBL_NAMESPACE): To _GLIBCXX_BEGIN_NAMESPACE_LDBL.
(_GLIBCXX_END_LDBL_NAMESPACE): To _GLIBCXX_END_NAMESPACE_LDBL.
(_GLIBCXX_VISIBILITY_ATTR): Revert to _GLIBCXX_VISIBILITY.
* include/*: Use new macros for namespace scope.
* config/*: Same.
* src/*: Same.
* src/Makefile.am (sources): Remove debug_list.cc, add
compatibility-debug_list-2.cc.
(parallel_sources): Remove parallel_list.cc, add
compatibility-parallel_list-2.cc.
(compatibility-parallel_list-2.[o,lo]): New rule.
* src/Makefile.in: Regenerate.
* src/debug_list.cc: Remove.
* src/parallel_list.cc: Remove.
* src/compatibility-list-2.cc: New.
* src/compatibility-debug_list-2.cc: New.
* src/compatibility-parallel_list-2.cc: New.
* doc/doxygen/user.cfg.in: Adjust macros.
* testsuite/20_util/auto_ptr/assign_neg.cc: Adjust line numbers, macros.
* testsuite/20_util/declval/requirements/1_neg.cc: Same.
* testsuite/20_util/duration/requirements/typedefs_neg1.cc: Same.
* testsuite/20_util/duration/requirements/typedefs_neg2.cc: Same.
* testsuite/20_util/duration/requirements/typedefs_neg3.cc: Same.
* testsuite/20_util/forward/c_neg.cc: Same.
* testsuite/20_util/forward/f_neg.cc: Same.
* testsuite/20_util/make_signed/requirements/typedefs_neg.cc: Same.
* testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc: Same.
* testsuite/20_util/ratio/cons/cons_overflow_neg.cc: Same.
* testsuite/20_util/ratio/operations/ops_overflow_neg.cc: Same.
* testsuite/20_util/shared_ptr/cons/43820_neg.cc: Same.
* testsuite/20_util/weak_ptr/comparison/cmp_neg.cc: Same.
* testsuite/23_containers/deque/requirements/dr438/assign_neg.cc: Same.
* testsuite/23_containers/deque/requirements/dr438/
constructor_1_neg.cc: Same.
* testsuite/23_containers/deque/requirements/dr438/
constructor_2_neg.cc: Same.
* testsuite/23_containers/deque/requirements/dr438/insert_neg.cc: Same.
* testsuite/23_containers/forward_list/capacity/1.cc: Same.
* testsuite/23_containers/forward_list/requirements/dr438/
assign_neg.cc: Same.
* testsuite/23_containers/forward_list/requirements/dr438/
constructor_1_neg.cc: Same.
* testsuite/23_containers/forward_list/requirements/dr438/
constructor_2_neg.cc: Same.
* testsuite/23_containers/forward_list/requirements/dr438/
insert_neg.cc: Same.
* testsuite/23_containers/list/capacity/29134.cc: Same.
* testsuite/23_containers/list/requirements/dr438/assign_neg.cc: Same.
* testsuite/23_containers/list/requirements/dr438/
constructor_1_neg.cc: Same.
* testsuite/23_containers/list/requirements/dr438/
constructor_2_neg.cc: Same.
* testsuite/23_containers/list/requirements/dr438/insert_neg.cc: Same.
* testsuite/23_containers/vector/bool/capacity/29134.cc: Same.
* testsuite/23_containers/vector/bool/modifiers/insert/31370.cc: Same.
* testsuite/23_containers/vector/requirements/dr438/assign_neg.cc: Same.
* testsuite/23_containers/vector/requirements/dr438/
constructor_1_neg.cc: Same.
* testsuite/23_containers/vector/requirements/dr438/
constructor_2_neg.cc: Same.
* testsuite/23_containers/vector/requirements/dr438/insert_neg.cc: Same.
* testsuite/25_algorithms/sort/35588.cc: Same.
* testsuite/27_io/ios_base/cons/assign_neg.cc: Same.
* testsuite/27_io/ios_base/cons/copy_neg.cc: Same.
* testsuite/ext/profile/mutex_extensions_neg.cc: Same.
* testsuite/ext/profile/profiler_algos.cc: Same.
* testsuite/ext/type_traits/add_unsigned_floating_neg.cc: Same.
* testsuite/ext/type_traits/add_unsigned_integer_neg.cc: Same.
* testsuite/ext/type_traits/remove_unsigned_floating_neg.cc: Same.
* testsuite/ext/type_traits/remove_unsigned_integer_neg.cc: Same.
* testsuite/tr1/2_general_utilities/shared_ptr/cons/43820_neg.cc: Same.
From-SVN: r169421
2011-01-30 23:39:36 +01:00
|
|
|
_GLIBCXX_END_NAMESPACE_VERSION
|
|
|
|
} // namespace
|
2000-10-05 13:27:02 +02:00
|
|
|
|
2008-08-20 21:29:54 +02:00
|
|
|
#if (defined(__GXX_EXPERIMENTAL_CXX0X__) \
|
|
|
|
&& defined(_GLIBCXX_USE_C99_STDINT_TR1))
|
|
|
|
|
|
|
|
#include <cstdint>
|
|
|
|
|
PR libstdc++/36104 part four
2011-01-30 Benjamin Kosnik <bkoz@redhat.com>
PR libstdc++/36104 part four
* include/bits/c++config (_GLIBCXX_STD): Remove.
(_GLIBCXX_STD_D, _GLIBCXX_PR): Now _GLIBCXX_STD_C.
(_GLIBCXX_P): Now _GLIBCXX_STD_A.
(_GLIBCXX_NAMESPACE_DEBUG, _GLIBCXX_NAMESPACE_PARALLEL,
_GLIBCXX_NAMESPACE_PROFILE, _GLIBCXX_NAMESPACE_VERSION): Remove.
(_GLIBCXX_INLINE_DEBUG, _GLIBCXX_INLINE_PARALLEL,
_GLIBCXX_INLINE_PROFILE): Remove.
(_GLIBCXX_BEGIN_NAMESPACE(X)): Remove.
(_GLIBCXX_END_NAMESPACE): Remove.
(_GLIBCXX_BEGIN_NESTED_NAMESPACE(X, Y)): Remove.
(_GLIBCXX_END_NESTED_NAMESPACE): Remove.
(_GLIBCXX_BEGIN_NAMESPACE_ALGO): Add.
(_GLIBCXX_END_NAMESPACE_ALGO): Add.
(_GLIBCXX_BEGIN_NAMESPACE_CONTAINER): Add.
(_GLIBCXX_END_NAMESPACE_CONTAINER): Add.
(_GLIBCXX_BEGIN_NAMESPACE_VERSION): Add.
(_GLIBCXX_END_NAMESPACE_VERSION): Add.
(_GLIBCXX_BEGIN_LDBL_NAMESPACE): To _GLIBCXX_BEGIN_NAMESPACE_LDBL.
(_GLIBCXX_END_LDBL_NAMESPACE): To _GLIBCXX_END_NAMESPACE_LDBL.
(_GLIBCXX_VISIBILITY_ATTR): Revert to _GLIBCXX_VISIBILITY.
* include/*: Use new macros for namespace scope.
* config/*: Same.
* src/*: Same.
* src/Makefile.am (sources): Remove debug_list.cc, add
compatibility-debug_list-2.cc.
(parallel_sources): Remove parallel_list.cc, add
compatibility-parallel_list-2.cc.
(compatibility-parallel_list-2.[o,lo]): New rule.
* src/Makefile.in: Regenerate.
* src/debug_list.cc: Remove.
* src/parallel_list.cc: Remove.
* src/compatibility-list-2.cc: New.
* src/compatibility-debug_list-2.cc: New.
* src/compatibility-parallel_list-2.cc: New.
* doc/doxygen/user.cfg.in: Adjust macros.
* testsuite/20_util/auto_ptr/assign_neg.cc: Adjust line numbers, macros.
* testsuite/20_util/declval/requirements/1_neg.cc: Same.
* testsuite/20_util/duration/requirements/typedefs_neg1.cc: Same.
* testsuite/20_util/duration/requirements/typedefs_neg2.cc: Same.
* testsuite/20_util/duration/requirements/typedefs_neg3.cc: Same.
* testsuite/20_util/forward/c_neg.cc: Same.
* testsuite/20_util/forward/f_neg.cc: Same.
* testsuite/20_util/make_signed/requirements/typedefs_neg.cc: Same.
* testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc: Same.
* testsuite/20_util/ratio/cons/cons_overflow_neg.cc: Same.
* testsuite/20_util/ratio/operations/ops_overflow_neg.cc: Same.
* testsuite/20_util/shared_ptr/cons/43820_neg.cc: Same.
* testsuite/20_util/weak_ptr/comparison/cmp_neg.cc: Same.
* testsuite/23_containers/deque/requirements/dr438/assign_neg.cc: Same.
* testsuite/23_containers/deque/requirements/dr438/
constructor_1_neg.cc: Same.
* testsuite/23_containers/deque/requirements/dr438/
constructor_2_neg.cc: Same.
* testsuite/23_containers/deque/requirements/dr438/insert_neg.cc: Same.
* testsuite/23_containers/forward_list/capacity/1.cc: Same.
* testsuite/23_containers/forward_list/requirements/dr438/
assign_neg.cc: Same.
* testsuite/23_containers/forward_list/requirements/dr438/
constructor_1_neg.cc: Same.
* testsuite/23_containers/forward_list/requirements/dr438/
constructor_2_neg.cc: Same.
* testsuite/23_containers/forward_list/requirements/dr438/
insert_neg.cc: Same.
* testsuite/23_containers/list/capacity/29134.cc: Same.
* testsuite/23_containers/list/requirements/dr438/assign_neg.cc: Same.
* testsuite/23_containers/list/requirements/dr438/
constructor_1_neg.cc: Same.
* testsuite/23_containers/list/requirements/dr438/
constructor_2_neg.cc: Same.
* testsuite/23_containers/list/requirements/dr438/insert_neg.cc: Same.
* testsuite/23_containers/vector/bool/capacity/29134.cc: Same.
* testsuite/23_containers/vector/bool/modifiers/insert/31370.cc: Same.
* testsuite/23_containers/vector/requirements/dr438/assign_neg.cc: Same.
* testsuite/23_containers/vector/requirements/dr438/
constructor_1_neg.cc: Same.
* testsuite/23_containers/vector/requirements/dr438/
constructor_2_neg.cc: Same.
* testsuite/23_containers/vector/requirements/dr438/insert_neg.cc: Same.
* testsuite/25_algorithms/sort/35588.cc: Same.
* testsuite/27_io/ios_base/cons/assign_neg.cc: Same.
* testsuite/27_io/ios_base/cons/copy_neg.cc: Same.
* testsuite/ext/profile/mutex_extensions_neg.cc: Same.
* testsuite/ext/profile/profiler_algos.cc: Same.
* testsuite/ext/type_traits/add_unsigned_floating_neg.cc: Same.
* testsuite/ext/type_traits/add_unsigned_integer_neg.cc: Same.
* testsuite/ext/type_traits/remove_unsigned_floating_neg.cc: Same.
* testsuite/ext/type_traits/remove_unsigned_integer_neg.cc: Same.
* testsuite/tr1/2_general_utilities/shared_ptr/cons/43820_neg.cc: Same.
From-SVN: r169421
2011-01-30 23:39:36 +01:00
|
|
|
namespace std _GLIBCXX_VISIBILITY(default)
|
|
|
|
{
|
|
|
|
_GLIBCXX_BEGIN_NAMESPACE_VERSION
|
2008-08-20 21:29:54 +02:00
|
|
|
|
|
|
|
template<>
|
|
|
|
struct char_traits<char16_t>
|
|
|
|
{
|
|
|
|
typedef char16_t char_type;
|
|
|
|
typedef uint_least16_t int_type;
|
|
|
|
typedef streamoff off_type;
|
|
|
|
typedef u16streampos pos_type;
|
|
|
|
typedef mbstate_t state_type;
|
|
|
|
|
|
|
|
static void
|
|
|
|
assign(char_type& __c1, const char_type& __c2)
|
|
|
|
{ __c1 = __c2; }
|
|
|
|
|
2010-11-02 03:35:28 +01:00
|
|
|
static _GLIBCXX_CONSTEXPR bool
|
2008-08-20 21:29:54 +02:00
|
|
|
eq(const char_type& __c1, const char_type& __c2)
|
|
|
|
{ return __c1 == __c2; }
|
|
|
|
|
2010-11-02 03:35:28 +01:00
|
|
|
static _GLIBCXX_CONSTEXPR bool
|
2008-08-20 21:29:54 +02:00
|
|
|
lt(const char_type& __c1, const char_type& __c2)
|
|
|
|
{ return __c1 < __c2; }
|
|
|
|
|
|
|
|
static int
|
|
|
|
compare(const char_type* __s1, const char_type* __s2, size_t __n)
|
|
|
|
{
|
|
|
|
for (size_t __i = 0; __i < __n; ++__i)
|
|
|
|
if (lt(__s1[__i], __s2[__i]))
|
|
|
|
return -1;
|
|
|
|
else if (lt(__s2[__i], __s1[__i]))
|
|
|
|
return 1;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static size_t
|
|
|
|
length(const char_type* __s)
|
|
|
|
{
|
|
|
|
size_t __i = 0;
|
|
|
|
while (!eq(__s[__i], char_type()))
|
|
|
|
++__i;
|
|
|
|
return __i;
|
|
|
|
}
|
|
|
|
|
|
|
|
static const char_type*
|
|
|
|
find(const char_type* __s, size_t __n, const char_type& __a)
|
|
|
|
{
|
|
|
|
for (size_t __i = 0; __i < __n; ++__i)
|
|
|
|
if (eq(__s[__i], __a))
|
|
|
|
return __s + __i;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static char_type*
|
|
|
|
move(char_type* __s1, const char_type* __s2, size_t __n)
|
|
|
|
{
|
|
|
|
return (static_cast<char_type*>
|
|
|
|
(__builtin_memmove(__s1, __s2, __n * sizeof(char_type))));
|
|
|
|
}
|
|
|
|
|
|
|
|
static char_type*
|
|
|
|
copy(char_type* __s1, const char_type* __s2, size_t __n)
|
|
|
|
{
|
|
|
|
return (static_cast<char_type*>
|
|
|
|
(__builtin_memcpy(__s1, __s2, __n * sizeof(char_type))));
|
|
|
|
}
|
|
|
|
|
|
|
|
static char_type*
|
|
|
|
assign(char_type* __s, size_t __n, char_type __a)
|
char_traits.h (char_traits<char16_t>:: assign(char_type*, size_t, char_type), [...]): For now, just open-code.
2008-08-20 Paolo Carlini <paolo.carlini@oracle.com>
* include/bits/char_traits.h (char_traits<char16_t>::
assign(char_type*, size_t, char_type), char_traits<char32_t>::
assign(char_type*, size_t, char_type)): For now, just open-code.
From-SVN: r139367
2008-08-21 03:06:45 +02:00
|
|
|
{
|
|
|
|
for (size_t __i = 0; __i < __n; ++__i)
|
|
|
|
assign(__s[__i], __a);
|
2008-08-20 21:29:54 +02:00
|
|
|
return __s;
|
|
|
|
}
|
|
|
|
|
2010-11-02 03:35:28 +01:00
|
|
|
static _GLIBCXX_CONSTEXPR char_type
|
char_traits.h (char_traits<char16_t>:: assign(char_type*, size_t, char_type), [...]): For now, just open-code.
2008-08-20 Paolo Carlini <paolo.carlini@oracle.com>
* include/bits/char_traits.h (char_traits<char16_t>::
assign(char_type*, size_t, char_type), char_traits<char32_t>::
assign(char_type*, size_t, char_type)): For now, just open-code.
From-SVN: r139367
2008-08-21 03:06:45 +02:00
|
|
|
to_char_type(const int_type& __c)
|
|
|
|
{ return char_type(__c); }
|
2008-08-20 21:29:54 +02:00
|
|
|
|
2010-11-02 03:35:28 +01:00
|
|
|
static _GLIBCXX_CONSTEXPR int_type
|
char_traits.h (char_traits<char16_t>:: assign(char_type*, size_t, char_type), [...]): For now, just open-code.
2008-08-20 Paolo Carlini <paolo.carlini@oracle.com>
* include/bits/char_traits.h (char_traits<char16_t>::
assign(char_type*, size_t, char_type), char_traits<char32_t>::
assign(char_type*, size_t, char_type)): For now, just open-code.
From-SVN: r139367
2008-08-21 03:06:45 +02:00
|
|
|
to_int_type(const char_type& __c)
|
|
|
|
{ return int_type(__c); }
|
2008-08-20 21:29:54 +02:00
|
|
|
|
2010-11-02 03:35:28 +01:00
|
|
|
static _GLIBCXX_CONSTEXPR bool
|
2008-08-20 21:29:54 +02:00
|
|
|
eq_int_type(const int_type& __c1, const int_type& __c2)
|
|
|
|
{ return __c1 == __c2; }
|
|
|
|
|
2010-11-02 03:35:28 +01:00
|
|
|
static _GLIBCXX_CONSTEXPR int_type
|
char_traits.h (char_traits<char16_t>:: assign(char_type*, size_t, char_type), [...]): For now, just open-code.
2008-08-20 Paolo Carlini <paolo.carlini@oracle.com>
* include/bits/char_traits.h (char_traits<char16_t>::
assign(char_type*, size_t, char_type), char_traits<char32_t>::
assign(char_type*, size_t, char_type)): For now, just open-code.
From-SVN: r139367
2008-08-21 03:06:45 +02:00
|
|
|
eof()
|
|
|
|
{ return static_cast<int_type>(-1); }
|
2008-08-20 21:29:54 +02:00
|
|
|
|
2010-11-02 03:35:28 +01:00
|
|
|
static _GLIBCXX_CONSTEXPR int_type
|
2008-08-20 21:29:54 +02:00
|
|
|
not_eof(const int_type& __c)
|
|
|
|
{ return eq_int_type(__c, eof()) ? 0 : __c; }
|
|
|
|
};
|
|
|
|
|
|
|
|
template<>
|
|
|
|
struct char_traits<char32_t>
|
|
|
|
{
|
|
|
|
typedef char32_t char_type;
|
|
|
|
typedef uint_least32_t int_type;
|
|
|
|
typedef streamoff off_type;
|
|
|
|
typedef u32streampos pos_type;
|
|
|
|
typedef mbstate_t state_type;
|
|
|
|
|
|
|
|
static void
|
|
|
|
assign(char_type& __c1, const char_type& __c2)
|
|
|
|
{ __c1 = __c2; }
|
|
|
|
|
2010-11-02 03:35:28 +01:00
|
|
|
static _GLIBCXX_CONSTEXPR bool
|
2008-08-20 21:29:54 +02:00
|
|
|
eq(const char_type& __c1, const char_type& __c2)
|
|
|
|
{ return __c1 == __c2; }
|
|
|
|
|
2010-11-02 03:35:28 +01:00
|
|
|
static _GLIBCXX_CONSTEXPR bool
|
2008-08-20 21:29:54 +02:00
|
|
|
lt(const char_type& __c1, const char_type& __c2)
|
|
|
|
{ return __c1 < __c2; }
|
|
|
|
|
|
|
|
static int
|
|
|
|
compare(const char_type* __s1, const char_type* __s2, size_t __n)
|
|
|
|
{
|
|
|
|
for (size_t __i = 0; __i < __n; ++__i)
|
|
|
|
if (lt(__s1[__i], __s2[__i]))
|
|
|
|
return -1;
|
|
|
|
else if (lt(__s2[__i], __s1[__i]))
|
|
|
|
return 1;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static size_t
|
|
|
|
length(const char_type* __s)
|
|
|
|
{
|
|
|
|
size_t __i = 0;
|
|
|
|
while (!eq(__s[__i], char_type()))
|
|
|
|
++__i;
|
|
|
|
return __i;
|
|
|
|
}
|
|
|
|
|
|
|
|
static const char_type*
|
|
|
|
find(const char_type* __s, size_t __n, const char_type& __a)
|
|
|
|
{
|
|
|
|
for (size_t __i = 0; __i < __n; ++__i)
|
|
|
|
if (eq(__s[__i], __a))
|
|
|
|
return __s + __i;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static char_type*
|
|
|
|
move(char_type* __s1, const char_type* __s2, size_t __n)
|
|
|
|
{
|
|
|
|
return (static_cast<char_type*>
|
|
|
|
(__builtin_memmove(__s1, __s2, __n * sizeof(char_type))));
|
|
|
|
}
|
|
|
|
|
|
|
|
static char_type*
|
|
|
|
copy(char_type* __s1, const char_type* __s2, size_t __n)
|
|
|
|
{
|
|
|
|
return (static_cast<char_type*>
|
|
|
|
(__builtin_memcpy(__s1, __s2, __n * sizeof(char_type))));
|
|
|
|
}
|
|
|
|
|
|
|
|
static char_type*
|
|
|
|
assign(char_type* __s, size_t __n, char_type __a)
|
|
|
|
{
|
char_traits.h (char_traits<char16_t>:: assign(char_type*, size_t, char_type), [...]): For now, just open-code.
2008-08-20 Paolo Carlini <paolo.carlini@oracle.com>
* include/bits/char_traits.h (char_traits<char16_t>::
assign(char_type*, size_t, char_type), char_traits<char32_t>::
assign(char_type*, size_t, char_type)): For now, just open-code.
From-SVN: r139367
2008-08-21 03:06:45 +02:00
|
|
|
for (size_t __i = 0; __i < __n; ++__i)
|
|
|
|
assign(__s[__i], __a);
|
2008-08-20 21:29:54 +02:00
|
|
|
return __s;
|
|
|
|
}
|
|
|
|
|
2010-11-02 03:35:28 +01:00
|
|
|
static _GLIBCXX_CONSTEXPR char_type
|
char_traits.h (char_traits<char16_t>:: assign(char_type*, size_t, char_type), [...]): For now, just open-code.
2008-08-20 Paolo Carlini <paolo.carlini@oracle.com>
* include/bits/char_traits.h (char_traits<char16_t>::
assign(char_type*, size_t, char_type), char_traits<char32_t>::
assign(char_type*, size_t, char_type)): For now, just open-code.
From-SVN: r139367
2008-08-21 03:06:45 +02:00
|
|
|
to_char_type(const int_type& __c)
|
|
|
|
{ return char_type(__c); }
|
2008-08-20 21:29:54 +02:00
|
|
|
|
2010-11-02 03:35:28 +01:00
|
|
|
static _GLIBCXX_CONSTEXPR int_type
|
char_traits.h (char_traits<char16_t>:: assign(char_type*, size_t, char_type), [...]): For now, just open-code.
2008-08-20 Paolo Carlini <paolo.carlini@oracle.com>
* include/bits/char_traits.h (char_traits<char16_t>::
assign(char_type*, size_t, char_type), char_traits<char32_t>::
assign(char_type*, size_t, char_type)): For now, just open-code.
From-SVN: r139367
2008-08-21 03:06:45 +02:00
|
|
|
to_int_type(const char_type& __c)
|
|
|
|
{ return int_type(__c); }
|
2008-08-20 21:29:54 +02:00
|
|
|
|
2010-11-02 03:35:28 +01:00
|
|
|
static _GLIBCXX_CONSTEXPR bool
|
2008-08-20 21:29:54 +02:00
|
|
|
eq_int_type(const int_type& __c1, const int_type& __c2)
|
|
|
|
{ return __c1 == __c2; }
|
|
|
|
|
2010-11-02 03:35:28 +01:00
|
|
|
static _GLIBCXX_CONSTEXPR int_type
|
char_traits.h (char_traits<char16_t>:: assign(char_type*, size_t, char_type), [...]): For now, just open-code.
2008-08-20 Paolo Carlini <paolo.carlini@oracle.com>
* include/bits/char_traits.h (char_traits<char16_t>::
assign(char_type*, size_t, char_type), char_traits<char32_t>::
assign(char_type*, size_t, char_type)): For now, just open-code.
From-SVN: r139367
2008-08-21 03:06:45 +02:00
|
|
|
eof()
|
|
|
|
{ return static_cast<int_type>(-1); }
|
2008-08-20 21:29:54 +02:00
|
|
|
|
2010-11-02 03:35:28 +01:00
|
|
|
static _GLIBCXX_CONSTEXPR int_type
|
2008-08-20 21:29:54 +02:00
|
|
|
not_eof(const int_type& __c)
|
|
|
|
{ return eq_int_type(__c, eof()) ? 0 : __c; }
|
|
|
|
};
|
|
|
|
|
PR libstdc++/36104 part four
2011-01-30 Benjamin Kosnik <bkoz@redhat.com>
PR libstdc++/36104 part four
* include/bits/c++config (_GLIBCXX_STD): Remove.
(_GLIBCXX_STD_D, _GLIBCXX_PR): Now _GLIBCXX_STD_C.
(_GLIBCXX_P): Now _GLIBCXX_STD_A.
(_GLIBCXX_NAMESPACE_DEBUG, _GLIBCXX_NAMESPACE_PARALLEL,
_GLIBCXX_NAMESPACE_PROFILE, _GLIBCXX_NAMESPACE_VERSION): Remove.
(_GLIBCXX_INLINE_DEBUG, _GLIBCXX_INLINE_PARALLEL,
_GLIBCXX_INLINE_PROFILE): Remove.
(_GLIBCXX_BEGIN_NAMESPACE(X)): Remove.
(_GLIBCXX_END_NAMESPACE): Remove.
(_GLIBCXX_BEGIN_NESTED_NAMESPACE(X, Y)): Remove.
(_GLIBCXX_END_NESTED_NAMESPACE): Remove.
(_GLIBCXX_BEGIN_NAMESPACE_ALGO): Add.
(_GLIBCXX_END_NAMESPACE_ALGO): Add.
(_GLIBCXX_BEGIN_NAMESPACE_CONTAINER): Add.
(_GLIBCXX_END_NAMESPACE_CONTAINER): Add.
(_GLIBCXX_BEGIN_NAMESPACE_VERSION): Add.
(_GLIBCXX_END_NAMESPACE_VERSION): Add.
(_GLIBCXX_BEGIN_LDBL_NAMESPACE): To _GLIBCXX_BEGIN_NAMESPACE_LDBL.
(_GLIBCXX_END_LDBL_NAMESPACE): To _GLIBCXX_END_NAMESPACE_LDBL.
(_GLIBCXX_VISIBILITY_ATTR): Revert to _GLIBCXX_VISIBILITY.
* include/*: Use new macros for namespace scope.
* config/*: Same.
* src/*: Same.
* src/Makefile.am (sources): Remove debug_list.cc, add
compatibility-debug_list-2.cc.
(parallel_sources): Remove parallel_list.cc, add
compatibility-parallel_list-2.cc.
(compatibility-parallel_list-2.[o,lo]): New rule.
* src/Makefile.in: Regenerate.
* src/debug_list.cc: Remove.
* src/parallel_list.cc: Remove.
* src/compatibility-list-2.cc: New.
* src/compatibility-debug_list-2.cc: New.
* src/compatibility-parallel_list-2.cc: New.
* doc/doxygen/user.cfg.in: Adjust macros.
* testsuite/20_util/auto_ptr/assign_neg.cc: Adjust line numbers, macros.
* testsuite/20_util/declval/requirements/1_neg.cc: Same.
* testsuite/20_util/duration/requirements/typedefs_neg1.cc: Same.
* testsuite/20_util/duration/requirements/typedefs_neg2.cc: Same.
* testsuite/20_util/duration/requirements/typedefs_neg3.cc: Same.
* testsuite/20_util/forward/c_neg.cc: Same.
* testsuite/20_util/forward/f_neg.cc: Same.
* testsuite/20_util/make_signed/requirements/typedefs_neg.cc: Same.
* testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc: Same.
* testsuite/20_util/ratio/cons/cons_overflow_neg.cc: Same.
* testsuite/20_util/ratio/operations/ops_overflow_neg.cc: Same.
* testsuite/20_util/shared_ptr/cons/43820_neg.cc: Same.
* testsuite/20_util/weak_ptr/comparison/cmp_neg.cc: Same.
* testsuite/23_containers/deque/requirements/dr438/assign_neg.cc: Same.
* testsuite/23_containers/deque/requirements/dr438/
constructor_1_neg.cc: Same.
* testsuite/23_containers/deque/requirements/dr438/
constructor_2_neg.cc: Same.
* testsuite/23_containers/deque/requirements/dr438/insert_neg.cc: Same.
* testsuite/23_containers/forward_list/capacity/1.cc: Same.
* testsuite/23_containers/forward_list/requirements/dr438/
assign_neg.cc: Same.
* testsuite/23_containers/forward_list/requirements/dr438/
constructor_1_neg.cc: Same.
* testsuite/23_containers/forward_list/requirements/dr438/
constructor_2_neg.cc: Same.
* testsuite/23_containers/forward_list/requirements/dr438/
insert_neg.cc: Same.
* testsuite/23_containers/list/capacity/29134.cc: Same.
* testsuite/23_containers/list/requirements/dr438/assign_neg.cc: Same.
* testsuite/23_containers/list/requirements/dr438/
constructor_1_neg.cc: Same.
* testsuite/23_containers/list/requirements/dr438/
constructor_2_neg.cc: Same.
* testsuite/23_containers/list/requirements/dr438/insert_neg.cc: Same.
* testsuite/23_containers/vector/bool/capacity/29134.cc: Same.
* testsuite/23_containers/vector/bool/modifiers/insert/31370.cc: Same.
* testsuite/23_containers/vector/requirements/dr438/assign_neg.cc: Same.
* testsuite/23_containers/vector/requirements/dr438/
constructor_1_neg.cc: Same.
* testsuite/23_containers/vector/requirements/dr438/
constructor_2_neg.cc: Same.
* testsuite/23_containers/vector/requirements/dr438/insert_neg.cc: Same.
* testsuite/25_algorithms/sort/35588.cc: Same.
* testsuite/27_io/ios_base/cons/assign_neg.cc: Same.
* testsuite/27_io/ios_base/cons/copy_neg.cc: Same.
* testsuite/ext/profile/mutex_extensions_neg.cc: Same.
* testsuite/ext/profile/profiler_algos.cc: Same.
* testsuite/ext/type_traits/add_unsigned_floating_neg.cc: Same.
* testsuite/ext/type_traits/add_unsigned_integer_neg.cc: Same.
* testsuite/ext/type_traits/remove_unsigned_floating_neg.cc: Same.
* testsuite/ext/type_traits/remove_unsigned_integer_neg.cc: Same.
* testsuite/tr1/2_general_utilities/shared_ptr/cons/43820_neg.cc: Same.
From-SVN: r169421
2011-01-30 23:39:36 +01:00
|
|
|
_GLIBCXX_END_NAMESPACE_VERSION
|
|
|
|
} // namespace
|
2008-08-20 21:29:54 +02:00
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif // _CHAR_TRAITS_H
|