string: tokeniser value_type should be view<Iterator>

This commit is contained in:
Danny Robson 2019-06-20 16:31:22 +10:00
parent 9243f259e2
commit e0350f912b

View File

@ -37,11 +37,10 @@ namespace cruft {
template <typename Iterator>
struct tokeniser {
public:
using value_type = typename std::iterator_traits<Iterator>::value_type;
using range_type = view<Iterator>;
using value_type = view<Iterator>;
using element_type = typename std::iterator_traits<Iterator>::value_type;
tokeniser (cruft::view<Iterator,Iterator> _range, value_type _separator):
tokeniser (cruft::view<Iterator,Iterator> _range, element_type _separator):
m_range (_range),
m_separator (_separator)
{ ; }
@ -54,7 +53,7 @@ namespace cruft {
struct iterator : public std::iterator<
std::forward_iterator_tag,
range_type,
value_type,
std::size_t
> {
public:
@ -100,7 +99,7 @@ namespace cruft {
}
private:
iterator (range_type _range, value_type _separator):
iterator (value_type _range, element_type _separator):
m_separator (_separator),
m_range {
_range.cbegin (),
@ -109,8 +108,8 @@ namespace cruft {
m_end (_range.cend ())
{ ; }
value_type m_separator;
range_type m_range;
element_type m_separator;
value_type m_range;
Iterator m_end;
friend tokeniser;
@ -143,8 +142,8 @@ namespace cruft {
}
private:
const range_type m_range;
const value_type m_separator;
const value_type m_range;
const element_type m_separator;
};