1, Changed castFromString to struct to better specialization.
2, Added const std::(w)string &, std::(w)string & overload to CastFromString to handle the cast correctly.
3, Added unit tests in test_variant.
Solve the issue https://github.com/cpgf/cpgf/issues/42