The code above works and I don't know why.
The function takes a String type object (not a std::string or char*), but works if you actually pass a char* or a compile-time string as an argument.
Could someone please explain how he did this?
I've looked through the source code but it's huge and I don't really know what to look for.
What makes this work for std::string is the non-explicit const char* constructor. I don't know of any other way to accomplish this so I guess it must be the same with your custom string class.