If you only have an iterator at hand and there is no parent (to the iterator) object (string), then you can do it like this
wchar_t* itAddress = &(*it); unsigned long n = ::wcstoul(itAddress, L'\0', 10);
Those. through an iterator we get a pointer to the data that is stored in the row (the iterator for the string itself is a pointer itself, in fact, you just need to convert it correctly)
If you have a parent string, you can do this:
unsigned long n = ::wcstoul(wstr.c_str() + 1, L'\0', 10);
Those. immediately legally (by string) we get a pointer to the data stored in the string
PS
Slightly corrected the code to determine where the wcstoul function finished
wchar_t* itAddress = &(*it); wchar_t* itAddressEnd = 0; unsigned long n = ::wcstoul(itAddress + 1, &itAddressEnd, 10); std::wstring::iterator itNew = it + ((long long)itAddressEnd - (long long)itAddress - 2);
-2 because 1) started with the symbol it + 1 - it gave -1 , 2) finished on the previous character - it gave -1 more