Access violation reading location 0x00000018.
Looks like you are calling a member function on a null object.
myThing = null;
Look on your stack trace, go back out on the stack to the outermost function that you wrote, and look for a null pointer on any object.
For example, maybe a null pointer value for the string you are trying to print.
Forgot to mention that the error leads me to line 512 in the file xstring.
You're looking in the wrong spot. While it is remotely possible that you found a bug in the standard library, consider that the libraries are used by millions of programmers around the globe every day. The odds that it works correctly for everybody else but is broken for you is astonishingly small.
Always assume the error is in your code, not in the standard library.
Following a hunch, it could be that map[i] doesn't exist, or that it doesn't contain a string (it is empty).
for (int i = 0; i < map.size(); i++)