STLdoc
STLdocumentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Functions
pod_char_traits.h File Reference
#include <string>

Go to the source code of this file.

Functions

namespace __gnu_cxx _GLIBCXX_VISIBILITY (default)
 

Detailed Description

This file is a GNU extension to the Standard C++ Library.

Function Documentation

namespace __gnu_cxx _GLIBCXX_VISIBILITY ( default  )

A POD class that serves as a character abstraction class.

char_traits<__gnu_cxx::character> specialization.

40 {
41 _GLIBCXX_BEGIN_NAMESPACE_VERSION
42 
43  // POD character abstraction.
44  // NB: The char_type parameter is a subset of int_type, as to allow
45  // int_type to properly hold the full range of char_type values as
46  // well as EOF.
48  template<typename V, typename I, typename S = std::mbstate_t>
49  struct character
50  {
51  typedef V value_type;
52  typedef I int_type;
53  typedef S state_type;
54  typedef character<V, I, S> char_type;
55 
56  value_type value;
57 
58  template<typename V2>
59  static char_type
60  from(const V2& v)
61  {
62  char_type ret = { static_cast<value_type>(v) };
63  return ret;
64  }
65 
66  template<typename V2>
67  static V2
68  to(const char_type& c)
69  {
70  V2 ret = { static_cast<V2>(c.value) };
71  return ret;
72  }
73 
74  };
75 
76  template<typename V, typename I, typename S>
77  inline bool
78  operator==(const character<V, I, S>& lhs, const character<V, I, S>& rhs)
79  { return lhs.value == rhs.value; }
80 
81  template<typename V, typename I, typename S>
82  inline bool
83  operator<(const character<V, I, S>& lhs, const character<V, I, S>& rhs)
84  { return lhs.value < rhs.value; }
85 
86 _GLIBCXX_END_NAMESPACE_VERSION
87 } // namespace
bool operator==(const exception_ptr &, const exception_ptr &) _GLIBCXX_USE_NOEXCEPT __attribute__((__pure__))