IvanFilipov/FMI-DSA

Dynamic_array potential logic error in insert_at

Closed this issue · 2 comments

size_t index = it - data_ptr; // the difference between the pointers it the wanted index

shouldn't it be size_t index = it - iterator(data), so we use the defined operator-() in class iterator ?

In this case data_ptr is automaticallty cast to iterator type, so iterator::operator-() is called.

Closing (not error at all)