mirror of https://github.com/CGAL/cgal
Add operator+(int) and operator-(other)
This commit is contained in:
parent
99f514122b
commit
000bae9889
|
|
@ -93,6 +93,25 @@ public:
|
|||
return tmp;
|
||||
}
|
||||
|
||||
Self operator+(std::size_t offset) const
|
||||
{
|
||||
// todo: make this a O(1) time operation
|
||||
Self res(*this);
|
||||
for(int i=0;i<offset;++i){
|
||||
++res;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
std::size_t operator-(Self other) const
|
||||
{
|
||||
// todo: make this a O(1) time operation
|
||||
std::size_t res = 0;
|
||||
while(other != *this){
|
||||
++res;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
reference operator*() const
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue