Commit d3e285a1 authored by Kirill Terekhov's avatar Kirill Terekhov
Browse files

conform iterators to new visual studio

parent 12f57876
...@@ -86,13 +86,12 @@ namespace INMOST ...@@ -86,13 +86,12 @@ namespace INMOST
_iterator operator +(size_t n) const { return _iterator(e+n); } _iterator operator +(size_t n) const { return _iterator(e+n); }
_iterator & operator +=(size_t n) { e+=n; return *this; } _iterator & operator +=(size_t n) { e+=n; return *this; }
_iterator & operator ++(){ ++e; return *this;} _iterator & operator ++(){ ++e; return *this;}
_iterator operator ++(int){ return _iterator(e++); } _iterator operator ++(int) { return _iterator(e++); }
_iterator & operator --(){ --e; return *this; } _iterator & operator --(){ --e; return *this; }
_iterator operator --(int){ return _iterator(e--); } _iterator operator --(int) { return _iterator(e--); }
ptrdiff_t operator -(const _iterator & other) const {return e-other.e;} ptrdiff_t operator -(const _iterator & other) const {return e-other.e;}
etype & operator *() { return *e; } etype & operator *() const { return *e; }
const etype & operator *() const { return *e; } etype * operator ->() const { return e; }
etype * operator ->() { return e; }
_iterator & operator =(_iterator const & other) { e = other.e; return *this; } _iterator & operator =(_iterator const & other) { e = other.e; return *this; }
bool operator ==(const _iterator & other) const { return e == other.e;} bool operator ==(const _iterator & other) const { return e == other.e;}
bool operator !=(const _iterator & other) const { return e != other.e;} bool operator !=(const _iterator & other) const { return e != other.e;}
...@@ -100,8 +99,7 @@ namespace INMOST ...@@ -100,8 +99,7 @@ namespace INMOST
bool operator >(const _iterator & other) const { return e > other.e;} bool operator >(const _iterator & other) const { return e > other.e;}
bool operator <=(const _iterator & other) const { return e <= other.e;} bool operator <=(const _iterator & other) const { return e <= other.e;}
bool operator >=(const _iterator & other) const { return e >= other.e;} bool operator >=(const _iterator & other) const { return e >= other.e;}
operator void *() {return static_cast<void *> (e);} operator void *() const {return static_cast<void *> (e);}
operator const void *() const {return const_cast<const void *> (e);}
}; };
typedef _iterator<element> iterator; typedef _iterator<element> iterator;
typedef _iterator<const element> const_iterator; typedef _iterator<const element> const_iterator;
...@@ -125,13 +123,12 @@ namespace INMOST ...@@ -125,13 +123,12 @@ namespace INMOST
_reverse_iterator operator +(size_t n) const {return _reverse_iterator(e-n); } _reverse_iterator operator +(size_t n) const {return _reverse_iterator(e-n); }
_reverse_iterator & operator +=(size_t n) { e-=n; return *this; } _reverse_iterator & operator +=(size_t n) { e-=n; return *this; }
_reverse_iterator & operator ++(){ --e; return *this;} _reverse_iterator & operator ++(){ --e; return *this;}
_reverse_iterator operator ++(int){ return _reverse_iterator(e--); } _reverse_iterator operator ++(int) { return _reverse_iterator(e--); }
_reverse_iterator & operator --(){ ++e; return *this; } _reverse_iterator & operator --(){ ++e; return *this; }
_reverse_iterator operator --(int){ return _reverse_iterator(e++); } _reverse_iterator operator --(int) { return _reverse_iterator(e++); }
ptrdiff_t operator -(const _reverse_iterator & other) const {return other.e-e;} ptrdiff_t operator -(const _reverse_iterator & other) const {return other.e-e;}
etype & operator *() { return *e; } etype & operator *() const { return *e; }
const etype & operator *() const { return *e; } etype * operator ->() const { return e; }
etype * operator ->() { return e; }
_reverse_iterator & operator =(_reverse_iterator const & other) { e = other.e; return *this;} _reverse_iterator & operator =(_reverse_iterator const & other) { e = other.e; return *this;}
bool operator ==(const _reverse_iterator & other) const { return e == other.e;} bool operator ==(const _reverse_iterator & other) const { return e == other.e;}
bool operator !=(const _reverse_iterator & other) const { return e != other.e;} bool operator !=(const _reverse_iterator & other) const { return e != other.e;}
...@@ -139,8 +136,7 @@ namespace INMOST ...@@ -139,8 +136,7 @@ namespace INMOST
bool operator >(const _reverse_iterator & other) const { return e > other.e;} bool operator >(const _reverse_iterator & other) const { return e > other.e;}
bool operator <=(const _reverse_iterator & other) const { return e <= other.e;} bool operator <=(const _reverse_iterator & other) const { return e <= other.e;}
bool operator >=(const _reverse_iterator & other) const { return e >= other.e;} bool operator >=(const _reverse_iterator & other) const { return e >= other.e;}
operator void *() {return static_cast<void *> (e);} operator void *()const {return static_cast<void *> (e);}
operator const void *() const {return static_cast<const void *> (e);}
}; };
typedef _reverse_iterator<element> reverse_iterator; typedef _reverse_iterator<element> reverse_iterator;
typedef _reverse_iterator<const element> const_reverse_iterator; typedef _reverse_iterator<const element> const_reverse_iterator;
...@@ -499,21 +495,20 @@ namespace INMOST ...@@ -499,21 +495,20 @@ namespace INMOST
_iterator operator +(size_t n) const { return _iterator(e+n); } _iterator operator +(size_t n) const { return _iterator(e+n); }
_iterator & operator +=(size_t n) { e+=n; return *this; } _iterator & operator +=(size_t n) { e+=n; return *this; }
_iterator & operator ++(){ ++e; return *this;} _iterator & operator ++(){ ++e; return *this;}
_iterator operator ++(int){ return _iterator(e++); } _iterator operator ++(int) { return _iterator(e++); }
_iterator & operator --(){ --e; return *this; } _iterator & operator --(){ --e; return *this; }
_iterator operator --(int){ return _iterator(e--); } _iterator operator --(int) { return _iterator(e--); }
ptrdiff_t operator -(const _iterator & other) const {return e-other.e;} ptrdiff_t operator -(const _iterator & other) const {return e-other.e;}
dtype & operator *() { return *e; } dtype & operator *() const { return *e; }
const dtype & operator *() const { return *e; } dtype * operator ->() const { return e; }
dtype * operator ->() { return e; }
_iterator & operator =(_iterator const & other) { e = other.e; return *this; } _iterator & operator =(_iterator const & other) { e = other.e; return *this; }
bool operator ==(const _iterator & other) { return e == other.e;} bool operator ==(const _iterator & other) const { return e == other.e;}
bool operator !=(const _iterator & other) { return e != other.e;} bool operator !=(const _iterator & other) const { return e != other.e;}
bool operator <(const _iterator & other) { return e < other.e;} bool operator <(const _iterator & other) const { return e < other.e;}
bool operator >(const _iterator & other) { return e > other.e;} bool operator >(const _iterator & other) const { return e > other.e;}
bool operator <=(const _iterator & other) { return e <= other.e;} bool operator <=(const _iterator & other) const { return e <= other.e;}
bool operator >=(const _iterator & other) { return e >= other.e;} bool operator >=(const _iterator & other) const { return e >= other.e;}
operator void *() {return static_cast<void *> (e);} operator void *() const {return static_cast<void *> (e);}
}; };
typedef _iterator<element> iterator; typedef _iterator<element> iterator;
typedef _iterator<const element> const_iterator; typedef _iterator<const element> const_iterator;
...@@ -537,21 +532,20 @@ namespace INMOST ...@@ -537,21 +532,20 @@ namespace INMOST
_reverse_iterator operator +(size_t n) const {return _reverse_iterator(e-n); } _reverse_iterator operator +(size_t n) const {return _reverse_iterator(e-n); }
_reverse_iterator & operator +=(size_t n) { e-=n; return *this; } _reverse_iterator & operator +=(size_t n) { e-=n; return *this; }
_reverse_iterator & operator ++(){ --e; return *this;} _reverse_iterator & operator ++(){ --e; return *this;}
_reverse_iterator operator ++(int){ return _reverse_iterator(e--); } _reverse_iterator operator ++(int) { return _reverse_iterator(e--); }
_reverse_iterator & operator --(){ ++e; return *this; } _reverse_iterator & operator --(){ ++e; return *this; }
_reverse_iterator operator --(int){ return _reverse_iterator(e++); } _reverse_iterator operator --(int) { return _reverse_iterator(e++); }
ptrdiff_t operator -(const _reverse_iterator & other) const {return other.e-e;} ptrdiff_t operator -(const _reverse_iterator & other) const {return other.e-e;}
dtype & operator *() { return *e; } dtype & operator *() const { return *e; }
const dtype & operator *() const { return *e; } dtype * operator ->() const { return e; }
dtype * operator ->() { return e; }
_reverse_iterator & operator =(_reverse_iterator const & other) { e = other.e; return *this;} _reverse_iterator & operator =(_reverse_iterator const & other) { e = other.e; return *this;}
bool operator ==(const _reverse_iterator & other) { return e == other.e;} bool operator ==(const _reverse_iterator & other) const { return e == other.e;}
bool operator !=(const _reverse_iterator & other) { return e != other.e;} bool operator !=(const _reverse_iterator & other) const { return e != other.e;}
bool operator <(const _reverse_iterator & other) { return e < other.e;} bool operator <(const _reverse_iterator & other) const { return e < other.e;}
bool operator >(const _reverse_iterator & other) { return e > other.e;} bool operator >(const _reverse_iterator & other) const { return e > other.e;}
bool operator <=(const _reverse_iterator & other) { return e <= other.e;} bool operator <=(const _reverse_iterator & other) const { return e <= other.e;}
bool operator >=(const _reverse_iterator & other) { return e >= other.e;} bool operator >=(const _reverse_iterator & other)const { return e >= other.e;}
operator void *() {return static_cast<void *> (e);} operator void *() const {return static_cast<void *> (e);}
}; };
typedef _reverse_iterator<element> reverse_iterator; typedef _reverse_iterator<element> reverse_iterator;
typedef _reverse_iterator<const element> const_reverse_iterator; typedef _reverse_iterator<const element> const_reverse_iterator;
...@@ -1039,13 +1033,12 @@ namespace INMOST ...@@ -1039,13 +1033,12 @@ namespace INMOST
_iterator operator +(size_type n) const { return _iterator(e+n); } _iterator operator +(size_type n) const { return _iterator(e+n); }
_iterator & operator +=(size_type n) { e+=n; return *this; } _iterator & operator +=(size_type n) { e+=n; return *this; }
_iterator & operator ++(){ ++e; return *this;} _iterator & operator ++(){ ++e; return *this;}
_iterator operator ++(int){ return _iterator(e++); } _iterator operator ++(int) { return _iterator(e++); }
_iterator & operator --(){ --e; return *this; } _iterator & operator --(){ --e; return *this; }
_iterator operator --(int){ return _iterator(e--); } _iterator operator --(int) { return _iterator(e--); }
size_type operator -(const _iterator & other) const {return static_cast<size_type>(e-other.e);} size_type operator -(const _iterator & other) const {return static_cast<size_type>(e-other.e);}
dtype & operator *() { return *e; } dtype & operator *() const { return *e; }
const dtype & operator *() const { return *e; } dtype * operator ->() const { return e; }
dtype * operator ->() { return e; }
_iterator & operator =(_iterator const & other) { e = other.e; return *this; } _iterator & operator =(_iterator const & other) { e = other.e; return *this; }
bool operator ==(const _iterator & other) const { return e == other.e;} bool operator ==(const _iterator & other) const { return e == other.e;}
bool operator !=(const _iterator & other) const { return e != other.e;} bool operator !=(const _iterator & other) const { return e != other.e;}
...@@ -1053,8 +1046,7 @@ namespace INMOST ...@@ -1053,8 +1046,7 @@ namespace INMOST
bool operator >(const _iterator & other) const { return e > other.e;} bool operator >(const _iterator & other) const { return e > other.e;}
bool operator <=(const _iterator & other) const { return e <= other.e;} bool operator <=(const _iterator & other) const { return e <= other.e;}
bool operator >=(const _iterator & other) const { return e >= other.e;} bool operator >=(const _iterator & other) const { return e >= other.e;}
operator void *() {return static_cast<void *> (e);} operator void *()const {return static_cast<void *> (e);}
operator const void *() const {return static_cast<const void *> (e);}
}; };
typedef _iterator<element> iterator; typedef _iterator<element> iterator;
typedef _iterator<const element> const_iterator; typedef _iterator<const element> const_iterator;
...@@ -1078,13 +1070,12 @@ namespace INMOST ...@@ -1078,13 +1070,12 @@ namespace INMOST
_reverse_iterator operator +(size_type n) const {return _reverse_iterator(e-n); } _reverse_iterator operator +(size_type n) const {return _reverse_iterator(e-n); }
_reverse_iterator & operator +=(size_type n) { e-=n; return *this; } _reverse_iterator & operator +=(size_type n) { e-=n; return *this; }
_reverse_iterator & operator ++(){ --e; return *this;} _reverse_iterator & operator ++(){ --e; return *this;}
_reverse_iterator operator ++(int){ return _reverse_iterator(e--); } _reverse_iterator operator ++(int) { return _reverse_iterator(e--); }
_reverse_iterator & operator --(){ ++e; return *this; } _reverse_iterator & operator --(){ ++e; return *this; }
_reverse_iterator operator --(int){ return _reverse_iterator(e++); } _reverse_iterator operator --(int){ return _reverse_iterator(e++); }
size_type operator -(const _reverse_iterator & other) const {return static_cast<size_type>(other.e-e);} size_type operator -(const _reverse_iterator & other) const {return static_cast<size_type>(other.e-e);}
dtype & operator *() { return *e; } dtype & operator *() const { return *e; }
const dtype & operator *() const { return *e; } dtype * operator ->() const { return e; }
dtype * operator ->() { return e; }
_reverse_iterator & operator =(_reverse_iterator const & other) { e = other.e; return *this;} _reverse_iterator & operator =(_reverse_iterator const & other) { e = other.e; return *this;}
bool operator ==(const _reverse_iterator & other) const { return e == other.e;} bool operator ==(const _reverse_iterator & other) const { return e == other.e;}
bool operator !=(const _reverse_iterator & other) const { return e != other.e;} bool operator !=(const _reverse_iterator & other) const { return e != other.e;}
...@@ -1092,8 +1083,7 @@ namespace INMOST ...@@ -1092,8 +1083,7 @@ namespace INMOST
bool operator >(const _reverse_iterator & other) const { return e > other.e;} bool operator >(const _reverse_iterator & other) const { return e > other.e;}
bool operator <=(const _reverse_iterator & other) const { return e <= other.e;} bool operator <=(const _reverse_iterator & other) const { return e <= other.e;}
bool operator >=(const _reverse_iterator & other) const { return e >= other.e;} bool operator >=(const _reverse_iterator & other) const { return e >= other.e;}
operator void *() {return static_cast<void *> (e);} operator void *() const {return static_cast<void *> (e);}
operator const void *() const {return static_cast<const void *> (e);}
}; };
typedef _reverse_iterator<element> reverse_iterator; typedef _reverse_iterator<element> reverse_iterator;
typedef _reverse_iterator<const element> const_reverse_iterator; typedef _reverse_iterator<const element> const_reverse_iterator;
...@@ -1411,9 +1401,11 @@ namespace INMOST ...@@ -1411,9 +1401,11 @@ namespace INMOST
void clear() void clear()
{ {
if (next) if (next)
{
next->clear(); next->clear();
for (size_t k = 0; k < ne; ++k) delete next;
e[k].~element(); next = NULL;
}
ne = 0; ne = 0;
} }
element & operator [](size_t n) element & operator [](size_t n)
...@@ -1453,12 +1445,15 @@ namespace INMOST ...@@ -1453,12 +1445,15 @@ namespace INMOST
{ {
if (new_n <= base) if (new_n <= base)
{ {
for (size_t k = new_n; k < ne; ++k)
e[k].~element();
for (size_t k = ne; k < new_n; ++k) for (size_t k = ne; k < new_n; ++k)
new (&e[k]) element(c); e[k] = c;
ne = new_n; ne = new_n;
if( next ) next->clear(); if (next)
{
next->clear();
delete next;
next = NULL;
}
} }
else else
{ {
...@@ -1467,17 +1462,13 @@ namespace INMOST ...@@ -1467,17 +1462,13 @@ namespace INMOST
if (ne < base) if (ne < base)
{ {
for (size_t k = ne; k < base; ++k) for (size_t k = ne; k < base; ++k)
new (&e[k]) element(c); e[k] = c;
ne = base; ne = base;
} }
next->resize(new_n-base); next->resize(new_n-base,c);
} }
} }
~linked_array() ~linked_array() {clear();}
{
clear();
if( next ) delete next;
}
}; };
template<typename element, int block_bits> template<typename element, int block_bits>
...@@ -1551,13 +1542,12 @@ namespace INMOST ...@@ -1551,13 +1542,12 @@ namespace INMOST
iterator operator +(size_type n) const { return iterator(link,pos+n); } iterator operator +(size_type n) const { return iterator(link,pos+n); }
iterator & operator +=(size_type n) { pos+=n; return *this; } iterator & operator +=(size_type n) { pos+=n; return *this; }
iterator & operator ++(){ ++pos; return *this;} iterator & operator ++(){ ++pos; return *this;}
iterator operator ++(int){ return iterator(link,pos++); } iterator operator ++(int) { return iterator(link,pos++); }
iterator & operator --(){ --pos; return *this; } iterator & operator --(){ --pos; return *this; }
iterator operator --(int){ return iterator(link,pos--); } iterator operator --(int) { return iterator(link,pos--); }
ptrdiff_t operator -(const iterator & other) const {return pos-other.pos;} ptrdiff_t operator -(const iterator & other) const {return pos-other.pos;}
element & operator *() { return link->at(pos); } element & operator *() const { return link->at(pos); }
const element & operator *() const { return link->at(pos); } element * operator ->() const { return &link->at(pos); }
element * operator ->() { return &link->at(pos); }
iterator & operator =(iterator const & other) { link = other.link; pos = other.pos; return *this; } iterator & operator =(iterator const & other) { link = other.link; pos = other.pos; return *this; }
bool operator ==(const iterator & other) const { assert(link == other.link); return pos == other.pos;} bool operator ==(const iterator & other) const { assert(link == other.link); return pos == other.pos;}
bool operator !=(const iterator & other) const { assert(link == other.link); return pos != other.pos;} bool operator !=(const iterator & other) const { assert(link == other.link); return pos != other.pos;}
...@@ -1587,12 +1577,12 @@ namespace INMOST ...@@ -1587,12 +1577,12 @@ namespace INMOST
const_iterator operator +(size_type n) const { return const_iterator(link,pos+n); } const_iterator operator +(size_type n) const { return const_iterator(link,pos+n); }
const_iterator & operator +=(size_type n) { pos+=n; return *this; } const_iterator & operator +=(size_type n) { pos+=n; return *this; }
const_iterator & operator ++(){ ++pos; return *this;} const_iterator & operator ++(){ ++pos; return *this;}
const_iterator operator ++(int){ return const_iterator(link,pos++); } const_iterator operator ++(int) { return const_iterator(link,pos++); }
const_iterator & operator --(){ --pos; return *this; } const_iterator & operator --(){ --pos; return *this; }
const_iterator operator --(int){ return const_iterator(link,pos--); } const_iterator operator --(int) { return const_iterator(link,pos--); }
ptrdiff_t operator -(const const_iterator & other) const {return pos-other.pos;} ptrdiff_t operator -(const const_iterator & other) const {return pos-other.pos;}
const element & operator *() { return link->at(pos); } const element & operator *() const { return link->at(pos); }
const element * operator ->() { return &link->at(pos); } const element * operator ->() const { return &link->at(pos); }
const_iterator & operator =(const_iterator const & other) { link = other.link; pos = other.pos; return *this; } const_iterator & operator =(const_iterator const & other) { link = other.link; pos = other.pos; return *this; }
bool operator ==(const const_iterator & other) const { assert(link == other.link); return pos == other.pos;} bool operator ==(const const_iterator & other) const { assert(link == other.link); return pos == other.pos;}
bool operator !=(const const_iterator & other) const { assert(link == other.link); return pos != other.pos;} bool operator !=(const const_iterator & other) const { assert(link == other.link); return pos != other.pos;}
...@@ -1672,7 +1662,7 @@ namespace INMOST ...@@ -1672,7 +1662,7 @@ namespace INMOST
clear(); clear();
inner_resize(other.size()); inner_resize(other.size());
for(size_type k = 0; k < other.size(); k++) for(size_type k = 0; k < other.size(); k++)
new(&access_element(k)) element(other.access_element(k)); access_element(k) = other.access_element(k);
m_size = other.size(); m_size = other.size();
} }
return *this; return *this;
...@@ -1695,14 +1685,14 @@ namespace INMOST ...@@ -1695,14 +1685,14 @@ namespace INMOST
void push_back(const element & e) void push_back(const element & e)
{ {
inner_resize(m_size+1); inner_resize(m_size+1);
new (&access_element(m_size)) element(e); access_element(m_size) = e;
m_size++; m_size++;
} }
void resize(size_type n, const element & e = element()) void resize(size_type n, const element & e = element())
{ {
inner_resize(n); inner_resize(n);
for(size_type k = m_size; k < n; k++) for(size_type k = m_size; k < n; k++)
new (&access_element(k)) element(e); access_element(k) = element(e);
m_size = n; m_size = n;
} }
...@@ -1717,6 +1707,7 @@ namespace INMOST ...@@ -1717,6 +1707,7 @@ namespace INMOST
iterator begin() {return iterator(this,0);} iterator begin() {return iterator(this,0);}
iterator end() {return iterator(this,m_size);} iterator end() {return iterator(this,m_size);}
const_iterator begin() const {return const_iterator(this,0);} const_iterator begin() const {return const_iterator(this,0);}
const_iterator end() const {return const_iterator(this,m_size);} const_iterator end() const {return const_iterator(this,m_size);}
}; };
...@@ -2184,9 +2175,8 @@ namespace INMOST ...@@ -2184,9 +2175,8 @@ namespace INMOST
_iterator & operator --(){ --e; return *this; } _iterator & operator --(){ --e; return *this; }
_iterator operator --(int){ return _iterator(e--); } _iterator operator --(int){ return _iterator(e--); }
ptrdiff_t operator -(const _iterator & other) const {return e-other.e;} ptrdiff_t operator -(const _iterator & other) const {return e-other.e;}
etype & operator *() { return *e; } etype & operator *() const { return *e; }
const etype & operator *() const { return *e; } etype * operator ->() const { return e; }
etype * operator ->() { return e; }
_iterator & operator =(_iterator const & other) { e = other.e; return *this; } _iterator & operator =(_iterator const & other) { e = other.e; return *this; }
bool operator ==(const _iterator & other) const { return e == other.e;} bool operator ==(const _iterator & other) const { return e == other.e;}
bool operator !=(const _iterator & other) const { return e != other.e;} bool operator !=(const _iterator & other) const { return e != other.e;}
...@@ -2223,9 +2213,8 @@ namespace INMOST ...@@ -2223,9 +2213,8 @@ namespace INMOST
_reverse_iterator & operator --(){ ++e; return *this; } _reverse_iterator & operator --(){ ++e; return *this; }
_reverse_iterator operator --(int){ return _reverse_iterator(e++); } _reverse_iterator operator --(int){ return _reverse_iterator(e++); }
ptrdiff_t operator -(const _reverse_iterator & other) const {return other.e-e;} ptrdiff_t operator -(const _reverse_iterator & other) const {return other.e-e;}
etype & operator *() { return *e; } etype & operator *() const { return *e; }
const etype & operator *() const { return *e; } etype * operator ->() const { return e; }
etype * operator ->() { return e; }
_reverse_iterator & operator =(_reverse_iterator const & other) { e = other.e; return *this;} _reverse_iterator & operator =(_reverse_iterator const & other) { e = other.e; return *this;}
bool operator ==(const _reverse_iterator & other) const { return e == other.e;} bool operator ==(const _reverse_iterator & other) const { return e == other.e;}
bool operator !=(const _reverse_iterator & other) const { return e != other.e;} bool operator !=(const _reverse_iterator & other) const { return e != other.e;}
......
...@@ -169,8 +169,8 @@ namespace INMOST ...@@ -169,8 +169,8 @@ namespace INMOST
iterator & operator --() {cont_t::iterator::operator--(); return *this;} iterator & operator --() {cont_t::iterator::operator--(); return *this;}
iterator operator --(int) {iterator ret(*this); cont_t::iterator::operator--(); return ret;} iterator operator --(int) {iterator ret(*this); cont_t::iterator::operator--(); return ret;}
iterator & operator =(iterator const & other) {m_link = other.m_link; cont_t::iterator::operator=(static_cast<cont_t::iterator const &>(other)); return *this; } iterator & operator =(iterator const & other) {m_link = other.m_link; cont_t::iterator::operator=(static_cast<cont_t::iterator const &>(other)); return *this; }
HandleType & operator *() { return cont_t::iterator::operator *(); } HandleType & operator *() const { return cont_t::iterator::operator *(); }
StorageType operator->() { return StorageType(m_link,&cont_t::iterator::operator *()); } StorageType operator->() const { return StorageType(m_link,&cont_t::iterator::operator *()); }
}; };
class reverse_iterator : public cont_t::reverse_iterator class reverse_iterator : public cont_t::reverse_iterator
{ {
...@@ -186,8 +186,8 @@ namespace INMOST ...@@ -186,8 +186,8 @@ namespace INMOST
reverse_iterator & operator --() {cont_t::reverse_iterator::operator--(); return *this;} reverse_iterator & operator --() {cont_t::reverse_iterator::operator--(); return *this;}
reverse_iterator operator --(int) {reverse_iterator ret(*this); cont_t::reverse_iterator::operator--(); return ret;} reverse_iterator operator --(int) {reverse_iterator ret(*this); cont_t::reverse_iterator::operator--(); return ret;}
reverse_iterator & operator =(reverse_iterator const & other) {m_link = other.m_link; cont_t::reverse_iterator::operator=(static_cast<cont_t::reverse_iterator const &>(other)); return *this; } reverse_iterator & operator =(reverse_iterator const & other) {m_link = other.m_link; cont_t::reverse_iterator::operator=(static_cast<cont_t::reverse_iterator const &>(other)); return *this; }
HandleType & operator *() { return cont_t::reverse_iterator::operator *(); } HandleType & operator *() const { return cont_t::reverse_iterator::operator *(); }
StorageType operator->() { return StorageType(m_link,&cont_t::reverse_iterator::operator *()); } StorageType operator->() const { return StorageType(m_link,&cont_t::reverse_iterator::operator *()); }
}; };
class const_iterator : public cont_t::const_iterator class const_iterator : public cont_t::const_iterator
{ {
...@@ -201,8 +201,8 @@ namespace INMOST ...@@ -201,8 +201,8 @@ namespace INMOST
const_iterator & operator --() {cont_t::const_iterator::operator--(); return *this;} const_iterator & operator --() {cont_t::const_iterator::operator--(); return *this;}
const_iterator operator --(int) {const_iterator ret(*this); cont_t::const_iterator::operator--(); return ret;} const_iterator operator --(int) {const_iterator ret(*this); cont_t::const_iterator::operator--(); return ret;}
const_iterator & operator =(const_iterator const & other) {m_link = other.m_link; cont_t::const_iterator::operator=(static_cast<cont_t::const_iterator const &>(other)); return *this; } const_iterator & operator =(const_iterator const & other) {m_link = other.m_link; cont_t::const_iterator::operator=(static_cast<cont_t::const_iterator const &>(other)); return *this; }
const HandleType & operator *() { return cont_t::const_iterator::operator *(); } const HandleType & operator *() const { return cont_t::const_iterator::operator *(); }
StorageType operator->() { return StorageType(m_link,cont_t::const_iterator::operator *()); } StorageType operator->() const { return StorageType(m_link,cont_t::const_iterator::operator *()); }
}; };
class const_reverse_iterator : public cont_t::const_reverse_iterator class const_reverse_iterator : public cont_t::const_reverse_iterator
{ {
...@@ -216,8 +216,8 @@ namespace INMOST ...@@ -216,8 +216,8 @@ namespace INMOST
const_reverse_iterator & operator --() {cont_t::const_reverse_iterator::operator--(); return *this;} const_reverse_iterator & operator --() {cont_t::const_reverse_iterator::operator--(); return *this;}
const_reverse_iterator operator --(int) {const_reverse_iterator ret(*this); cont_t::const_reverse_iterator::operator--(); return ret;} const_reverse_iterator operator --(int) {const_reverse_iterator ret(*this); cont_t::const_reverse_iterator::operator--(); return ret;}
const_reverse_iterator & operator =(const_reverse_iterator const & other) { cont_t::const_reverse_iterator::operator=(static_cast<cont_t::const_reverse_iterator const &>(other)); return *this; } const_reverse_iterator & operator =(const_reverse_iterator const & other) { cont_t::const_reverse_iterator::operator=(static_cast<cont_t::const_reverse_iterator const &>(other)); return *this; }
const HandleType & operator *() { return cont_t::const_reverse_iterator::operator *(); } const HandleType & operator *() const { return cont_t::const_reverse_iterator::operator *(); }
StorageType operator->() { return StorageType(m_link,cont_t::const_reverse_iterator::operator *()); } StorageType operator->() const { return StorageType(m_link,cont_t::const_reverse_iterator::operator *()); }
}; };
public: public:
template<class InputIterator> template<class InputIterator>
......
...@@ -162,8 +162,8 @@ namespace INMOST ...@@ -162,8 +162,8 @@ namespace INMOST
INMOST_DATA_REAL_TYPE second; ///< the real value of the row element. INMOST_DATA_REAL_TYPE second; ///< the real value of the row element.
/// Comparison operator that helps sorting entries. /// Comparison operator that helps sorting entries.
bool operator < (const entry_s & other) const { return first < other.first || (first == other.first && second < other.second); } bool operator < (const entry_s & other) const { return first < other.first || (first == other.first && second < other.second); }
entry_s& operator =(entry_s const& b) { first = b.first; second = b.second; return *this; } //entry_s& operator =(entry_s const& b) { first = b.first; second = b.second; return *this; }
entry_s(const entry_s& b) : first(b.first), second(b.second) {} //entry_s(const entry_s& b) : first(b.first), second(b.second) {}
entry_s() : first(ENUMUNDEF), second(0.0) {} entry_s() : first(ENUMUNDEF), second(0.0) {}
} entry; } entry;
/// Assemble an entry of entry_s type. /// Assemble an entry of entry_s type.
......
...@@ -304,7 +304,7 @@ namespace INMOST ...@@ -304,7 +304,7 @@ namespace INMOST
{ {
ElementArray<Cell> n_cells = it->getCells(); //get all cells of the node ElementArray<Cell> n_cells = it->getCells(); //get all cells of the node
for (size_t k = 0; k < n_cells.size(); ++k) //assign local enumeration to the cells for (size_t k = 0; k < n_cells.size(); ++k) //assign local enumeration to the cells
n_cells[k].IntegerDF(indexes) = k; n_cells[k].IntegerDF(indexes) = static_cast<Storage::integer>(k);
for (size_t k = 0; k < n_faces.size(); ++k) //stich together node's numbers corresponding to cells if no fracture separates them for (size_t k = 0; k < n_faces.size(); ++k) //stich together node's numbers corresponding to cells if no fracture separates them
{ {
if (!n_faces[k].GetMarker(frac_markers) && n_faces[k].FrontCell().isValid()) if (!n_faces[k].GetMarker(frac_markers) && n_faces[k].FrontCell().isValid())
...@@ -988,7 +988,7 @@ namespace INMOST ...@@ -988,7 +988,7 @@ namespace INMOST
for (size_t k = 0; k < transfer.size(); ++k) //tags for (size_t k = 0; k < transfer.size(); ++k) //tags
{ {
INMOST_DATA_ENUM_TYPE size = a->GetDataSize(transfer[k]); INMOST_DATA_ENUM_TYPE size = a->GetDataSize(transfer[k]);
copy[k].resize(transfer[k].GetBytesSize()*size); copy[k].resize((size_t)transfer[k].GetBytesSize()*size);
if (!copy.empty()) a->GetData(transfer[k], 0, size, &copy[k][0]); if (!copy.empty()) a->GetData(transfer[k], 0, size, &copy[k][0]);
} }
...@@ -998,7 +998,7 @@ namespace INMOST ...@@ -998,7 +998,7 @@ namespace INMOST
//duplicate data //duplicate data
for (size_t k = 0; k < transfer.size(); ++k) for (size_t k = 0; k < transfer.size(); ++k)