diff options
Diffstat (limited to 'contrib/libstdc++/include/bits/char_traits.h')
-rw-r--r-- | contrib/libstdc++/include/bits/char_traits.h | 47 |
1 files changed, 19 insertions, 28 deletions
diff --git a/contrib/libstdc++/include/bits/char_traits.h b/contrib/libstdc++/include/bits/char_traits.h index 323fdfb..58cddf6 100644 --- a/contrib/libstdc++/include/bits/char_traits.h +++ b/contrib/libstdc++/include/bits/char_traits.h @@ -1,6 +1,6 @@ // Character Traits for use by standard string and iostream -*- C++ -*- -// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003 +// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 // Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free @@ -16,7 +16,7 @@ // 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 -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, +// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, // USA. // As a special exception, you may use this file as part of a free software @@ -28,15 +28,15 @@ // invalidate any other reasons why the executable file might be covered by // the GNU General Public License. -// -// ISO C++ 14882: 21 Strings library -// - /** @file char_traits.h * This is an internal header file, included by other library headers. * You should not attempt to use it directly. */ +// +// ISO C++ 14882: 21 Strings library +// + #ifndef _CHAR_TRAITS_H #define _CHAR_TRAITS_H 1 @@ -46,12 +46,11 @@ #include <bits/stl_algobase.h>// For copy, lexicographical_compare, fill_n #include <bits/postypes.h> // For streampos -namespace __gnu_cxx -{ +_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) + /** * @brief Mapping from character type to associated types. * - * * @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, @@ -82,7 +81,8 @@ namespace __gnu_cxx * * See http://gcc.gnu.org/onlinedocs/libstdc++/21_strings/howto.html#5 * for advice on how to make use of this class for "unusual" character - * types. Also, check out include/ext/pod_char_traits.h. */ + * types. Also, check out include/ext/pod_char_traits.h. + */ template<typename _CharT> struct char_traits { @@ -148,7 +148,7 @@ namespace __gnu_cxx char_traits<_CharT>:: compare(const char_type* __s1, const char_type* __s2, std::size_t __n) { - for (size_t __i = 0; __i < __n; ++__i) + for (std::size_t __i = 0; __i < __n; ++__i) if (lt(__s1[__i], __s2[__i])) return -1; else if (lt(__s2[__i], __s1[__i])) @@ -204,10 +204,11 @@ namespace __gnu_cxx std::fill_n(__s, __n, __a); return __s; } -} -namespace std -{ +_GLIBCXX_END_NAMESPACE + +_GLIBCXX_BEGIN_NAMESPACE(std) + // 21.1 /** * @brief Basis for explicit traits specializations. @@ -222,12 +223,11 @@ namespace std * types. Also, check out include/ext/pod_char_traits.h. */ template<class _CharT> - struct char_traits - : public __gnu_cxx::char_traits<_CharT> + struct char_traits : public __gnu_cxx::char_traits<_CharT> { }; - /// 21.1.3.1 char_traits specializations + /// @brief 21.1.3.1 char_traits specializations template<> struct char_traits<char> { @@ -297,7 +297,7 @@ namespace std #ifdef _GLIBCXX_USE_WCHAR_T - /// 21.1.3.2 char_traits specializations + /// @brief 21.1.3.2 char_traits specializations template<> struct char_traits<wchar_t> { @@ -362,15 +362,6 @@ namespace std }; #endif //_GLIBCXX_USE_WCHAR_T - template<typename _CharT, typename _Traits> - struct _Char_traits_match - { - _CharT _M_c; - _Char_traits_match(_CharT const& __c) : _M_c(__c) { } - - bool - operator()(_CharT const& __a) { return _Traits::eq(_M_c, __a); } - }; -} // namespace std +_GLIBCXX_END_NAMESPACE #endif |