@@ -39,6 +39,7 @@ class int_vector_buffer
39
39
class iterator ;
40
40
typedef typename int_vector<t_width>::difference_type difference_type;
41
41
typedef typename int_vector<t_width>::value_type value_type;
42
+ typedef typename int_vector<t_width>::size_type size_type;
42
43
43
44
private:
44
45
static_assert (t_width <= 64 , " int_vector_buffer: width must be at most 64 bits." );
@@ -489,12 +490,12 @@ class int_vector_buffer
489
490
class iterator : public std ::iterator<std::random_access_iterator_tag, value_type, difference_type, value_type*, reference>
490
491
{
491
492
private:
492
- int_vector_buffer<t_width>& m_ivb;
493
+ int_vector_buffer<t_width>* m_ivb;
493
494
uint64_t m_idx = 0 ;
494
495
public:
495
496
496
497
iterator () = delete ;
497
- iterator (int_vector_buffer<t_width>& ivb, uint64_t idx=0 ) : m_ivb(ivb), m_idx(idx) {}
498
+ iterator (int_vector_buffer<t_width>& ivb, uint64_t idx=0 ) : m_ivb(& ivb), m_idx(idx) {}
498
499
499
500
iterator& operator ++()
500
501
{
@@ -524,7 +525,7 @@ class int_vector_buffer
524
525
525
526
reference operator *()const
526
527
{
527
- return m_ivb[m_idx];
528
+ return (* m_ivb) [m_idx];
528
529
}
529
530
530
531
iterator& operator +=(difference_type i)
@@ -557,7 +558,7 @@ class int_vector_buffer
557
558
558
559
bool operator ==(const iterator& it) const
559
560
{
560
- return & m_ivb == &( it.m_ivb ) and m_idx == it.m_idx ;
561
+ return m_ivb == it.m_ivb and m_idx == it.m_idx ;
561
562
}
562
563
563
564
bool operator !=(const iterator& it) const
0 commit comments