I have a vector defined as vector<char>, and I have some function that is called at some point that receives a range - something like the following:
template <typename Iterator>
void foo(Iterator& start, Iterator& end)
{
}
In the above function, I currently have a call std::findto search for a given character - it's too slow (I know this because I profiled - :)). What I would like to do (at some point in the future, use the built-in functions of SSE4.2 to search for a character), but right now, what I want to do is vector search, that is, something like the following (not safe Job).
unsigned long long* scanv = reinterpret_cast<unsigned long long*>(<access pointer at start>);
so my question is the only way to do this is to pass a vector as well and then do distanceit then &vect[index]to access the base pointer?
source
share