In C and C++ anywhere a pointer or reference is accepted the null pointer is also accepted. The null pointer is notated as 0.
Pointers can be NULL (or 0) but references can not.
In this case I believe the compiler decided it could take your 0 and turn it into a string. However, looking at the reference for String, this should work.