Some C++ methods I'm importing into an Android project convert a string to a vector like below (as here):
#include <string>
#include <vector>
void myMethod(std::string str) {
std::vector<uint8_t> vec(str.begin(), str.end()); // error
}
While I do not get any build errors, Android Studio gives me a red line below vec(str.begin(), str.end())
stating
No matching constructor
The only constructor it suggests that has the __first
and __last
iterators has the following parameters:
_InputIterator __first, _InputIterator __last, const std::vector<unsigned char, std::__ndk1::allocator<unsigned char>>::allocator_type &__a, void * = 0
I would like to get rid of the red error line (tried these, didn't help), but I also do not want to spend extra time adapting C++ code that I supposedly should be able to more or less drop into the project. Do I need to worry about this as there are no build errors? If yes, how do I fix it?
I have installed every update offered by Android Studio to CMake, LLDB, NDK, etc.