It seems you are trying to convert a char const*
to a std::string::const_iterator
, e.g., when passing arguments to functions creating a range: although std::string::const_iterator
may be a typedef
for char const*
there is no requirement that this is the case. I don't think your code give enough context to pin-point the exact problem, though. You might want to look for locations where you pass a string literal or take the address of a section of a std::string
(i.e. something along the lines of &str[index]
or &*it
).
Based on you edit, what I suspected above actually got confirmed! You'll need to translate the char const*
s your are playing with back to std::string::const_iterator
s, e.g., by adding suitable offsets:
typename C::value_type(s.begin() + (p - s.c_str()), s.begin() + (q - s.c_str()))