compound: Use const bytes_view as iterator's value type

The iterator doesn't really allow modifying unserlying component.

This change enables using the iterator with boost::make_iterator_range() and
boost::range::join(), which get utterly confused otherwise.
This commit is contained in:
Tomasz Grabiec
2017-03-20 17:37:38 +01:00
parent 123b102dd6
commit 680ffd20f5

View File

@@ -130,10 +130,10 @@ public:
bytes decompose_value(const value_type& values) {
return serialize_value(values);
}
class iterator : public std::iterator<std::input_iterator_tag, bytes_view> {
class iterator : public std::iterator<std::input_iterator_tag, const bytes_view> {
private:
bytes_view _v;
value_type _current;
bytes_view _current;
private:
void read_current() {
size_type len;