Fix deprecation warning

Also put iterator into dhandy namespace. I don't
remember why I left it out, and it's probably a
sign I should have not done so.
This commit is contained in:
King_DuckZ 2024-04-26 00:19:50 +02:00
commit 4d904ac689
3 changed files with 70 additions and 3 deletions

View file

@ -5,12 +5,12 @@
#if !defined(INFIX_ITERATOR_H_)
#define INFIX_ITERATOR_H_
#include <ostream>
#include <iterator>
namespace dhandy {
template <class T,
class charT=char,
class traits=std::char_traits<charT> >
class infix_ostream_iterator :
public std::iterator<std::output_iterator_tag,void,void,void,void>
class infix_ostream_iterator
{
std::basic_ostream<charT,traits> *os;
charT const* delimiter;
@ -19,6 +19,13 @@ public:
typedef charT char_type;
typedef traits traits_type;
typedef std::basic_ostream<charT,traits> ostream_type;
using iterator_category = std::output_iterator_tag;
using value_type = void;
using difference_type = void;
using pointer = void;
using reference = void;
infix_ostream_iterator(ostream_type& s)
: os(&s),delimiter(0), first_elem(true)
{}
@ -45,4 +52,5 @@ public:
return *this;
}
};
} //namespace dhandy
#endif