mirror of https://github.com/davisking/dlib.git
parent
49ac2eb3ae
commit
d41571ea5a
|
@ -49,7 +49,10 @@ namespace dlib
|
||||||
<< "\n\t i: " << i
|
<< "\n\t i: " << i
|
||||||
<< "\n\t size(): " << size()
|
<< "\n\t size(): " << size()
|
||||||
);
|
);
|
||||||
return data[(i+offset)%data.size()];
|
auto index = i + offset;
|
||||||
|
if (index >= data.size())
|
||||||
|
index -= data.size();
|
||||||
|
return data[index];
|
||||||
}
|
}
|
||||||
|
|
||||||
const T& operator[] ( unsigned long i) const
|
const T& operator[] ( unsigned long i) const
|
||||||
|
@ -61,7 +64,10 @@ namespace dlib
|
||||||
<< "\n\t i: " << i
|
<< "\n\t i: " << i
|
||||||
<< "\n\t size(): " << size()
|
<< "\n\t size(): " << size()
|
||||||
);
|
);
|
||||||
return data[(i+offset)%data.size()];
|
auto index = i + offset;
|
||||||
|
if (index >= data.size())
|
||||||
|
index -= data.size();
|
||||||
|
return data[index];
|
||||||
}
|
}
|
||||||
|
|
||||||
void resize(unsigned long size)
|
void resize(unsigned long size)
|
||||||
|
|
Loading…
Reference in New Issue