My problem is, even though I use operator[] to get my vector contents, the vector is
calling always the size function (according to my profiling tool and time measurements).
So since my C++ application is very time critical (less than 0.1ms), i thought I’d better convert it into an array, but I couldn’t figure out so far.
The actual vector looks like:
std::vector<std::pair<double*,std::pair<double*,int*>>>
You can convert it to a pointer to the first element of an array like this:
Use
v.data()instead of&v[0]in C++11.Unrelatedly, I’m a little bit sceptical that the
size()function is taking up a measureable amount of time. It’s usually an inline function that either returns a field or returns the difference of two pointer fields.