+2001-06-26 Benjamin Kosnik <bkoz@redhat.com>
+
+ * include/bits/stream_iterator.h (istream_iterator): Add copy ctor.
+ (ostream_iterator): Same.
+ * include/bits/stl_iterator.h (front_insert_iterator::operator=):
+ Change argument to const_reference.
+ (back_insert_iterator): Same.
+
2001-06-26 Benjamin Kosnik <bkoz@redhat.com>
* include/bits/sbuf_iter.h: Change to..
back_insert_iterator(_Container& __x) : container(&__x) {}
back_insert_iterator&
- operator=(const typename _Container::value_type& __value)
+ operator=(const typename _Container::const_reference __value)
{
container->push_back(__value);
return *this;
explicit front_insert_iterator(_Container& __x) : container(&__x) {}
front_insert_iterator&
- operator=(const typename _Container::value_type& __value)
+ operator=(const typename _Container::const_reference __value)
{
container->push_front(__value);
return *this;
public:
istream_iterator() : _M_stream(0), _M_ok(false) {}
+
istream_iterator(istream_type& __s) : _M_stream(&__s) { _M_read(); }
+ istream_iterator(const istream_iterator& __obj)
+ : _M_stream(__obj._M_stream), _M_value(__obj._M_value),
+ _M_ok(__obj._M_ok)
+ { }
+
const _Tp&
operator*() const { return _M_value; }
template <class _Tp, class _CharT, class _Traits, class _Dist>
inline bool
- operator!=(const istream_iterator<_Tp, _CharT, _Traits, _Dist>& __x,
- const istream_iterator<_Tp, _CharT, _Traits, _Dist>& __y)
- { return !__x._M_equal(__y); }
+ operator!=(const istream_iterator<_Tp, _CharT, _Traits, _Dist>& __x,
+ const istream_iterator<_Tp, _CharT, _Traits, _Dist>& __y)
+ { return !__x._M_equal(__y); }
template<typename _Tp, typename _CharT = char,
public:
ostream_iterator(ostream_type& __s) : _M_stream(&__s), _M_string(0) {}
+
ostream_iterator(ostream_type& __s, const _CharT* __c)
- : _M_stream(&__s), _M_string(__c) { }
+ : _M_stream(&__s), _M_string(__c) { }
+
+ ostream_iterator(const ostream_iterator& __obj)
+ : _M_stream(__obj._M_stream), _M_string(__obj._M_string) { }
ostream_iterator&
operator=(const _Tp& __value)