I am trying to split a string the fastest way possible in C++. I am getting an error here:
#include <bitset>
#include <iostream>
#include <boost/algorithm/string/split.hpp>
#include <boost/algorithm/string/classification.hpp>
#include <boost/timer.hpp>
using namespace std;
size_t const N = 10000000;
template<typename C>
void test_strpbrk(string const& s, char const* delims, C& ret)
{
C output;
char const* p = s.c_str();
char const* q = strpbrk(p + 1, delims);
for (; q != NULL; q = strpbrk(p, delims))
{
output.push_back(typename C::value_type(p, q));
p = q + 1;
}
output.swap(ret);
}
int main()
{
typedef string::const_iterator iter;
typedef boost::iterator_range<iter> string_view;
vector<string_view> vsv;
test_custom(text, delims, vsv);
}
The Visual Studio says: cannot convert from 'const char *' to 'const std::_String_const_iterator<std::_String_val<std::_Simple_types<char>>>'
Can you please help me, should I enable any option in visual studio for this to work?