@@ -41,6 +41,7 @@ class basic_string {
4141 basic_string (std::size_t n, CharT c);
4242 basic_string (const CharT* str);
4343 basic_string (const CharT* str, std::size_t n);
44+ basic_string (const basic_string<CharT>& o);
4445
4546 iterator begin ();
4647 iterator end ();
@@ -55,17 +56,52 @@ class basic_string {
5556 CharT& operator [](std::size_t pos);
5657 const CharT *c_str () const ;
5758
59+ basic_string<CharT>& operator =(const basic_string<CharT>& o);
5860 basic_string<CharT>& operator +=(const CharT c);
5961 basic_string<CharT>& operator +=(const CharT* o);
6062 basic_string<CharT>& operator +=(const basic_string<CharT> &o);
6163};
6264
6365using string = basic_string<char >;
6466
65- std::istream& get_line (std::istream &i, std::string &str);
66-
6767} // namespace std end
6868
69+
70+ template <typename CharT>
71+ inline bool operator ==(const std::basic_string<CharT> &a, const CharT* b) { return std::strcmp (a.c_str (), b) == 0 ; }
72+ template <typename CharT>
73+ inline bool operator ==(const CharT* a, const std::basic_string<CharT> &b) { return std::strcmp (a, b.c_str ()) == 0 ; }
74+ template <typename CharT>
75+ inline bool operator ==(const std::basic_string<CharT> &a, const std::basic_string<CharT> &b) { return std::strcmp (a.c_str (), b.c_str ()) == 0 ; }
76+
77+ template <typename CharT>
78+ inline bool operator <(const std::basic_string<CharT> &a, const CharT* b) { return std::strcmp (a.c_str (), b) < 0 ; }
79+ template <typename CharT>
80+ inline bool operator <(const CharT* a, const std::basic_string<CharT> &b) { return std::strcmp (a, b.c_str ()) < 0 ; }
81+ template <typename CharT>
82+ inline bool operator <(const std::basic_string<CharT> &a, const std::basic_string<CharT> &b) { return std::strcmp (a.c_str (), b.c_str ()) < 0 ; }
83+
84+ template <typename CharT>
85+ inline bool operator >(const std::basic_string<CharT> &a, const CharT* b) { return std::strcmp (a.c_str (), b) > 0 ; }
86+ template <typename CharT>
87+ inline bool operator >(const CharT* a, const std::basic_string<CharT> &b) { return std::strcmp (a, b.c_str ()) > 0 ; }
88+ template <typename CharT>
89+ inline bool operator >(const std::basic_string<CharT> &a, const std::basic_string<CharT> &b) { return std::strcmp (a.c_str (), b.c_str ()) > 0 ; }
90+
91+ template <typename CharT>
92+ inline bool operator <=(const std::basic_string<CharT> &a, const CharT* b) { return !operator >(a,b); }
93+ template <typename CharT>
94+ inline bool operator <=(const CharT* a, const std::basic_string<CharT> &b) { return !operator >(a,b); }
95+ template <typename CharT>
96+ inline bool operator <=(const std::basic_string<CharT> &a, const std::basic_string<CharT> &b) { return !operator >(a,b); }
97+
98+ template <typename CharT>
99+ inline bool operator >=(const std::basic_string<CharT> &a, const CharT* b) { return !operator <(a,b); }
100+ template <typename CharT>
101+ inline bool operator >=(const CharT* a, const std::basic_string<CharT> &b) { return !operator <(a,b); }
102+ template <typename CharT>
103+ inline bool operator >=(const std::basic_string<CharT> &a, const std::basic_string<CharT> &b) { return !operator <(a,b); }
104+
69105#include < string.tcc>
70106
71107#endif
0 commit comments