Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Fix a bug in DateTimeParser where compound formats would get parsed as #178
Previously there were two overloads of parse in the code: parse(bool) and parse(const std::string&)
const char* can be converted to bool, and can also be converted to std::string, so either version is possible.
The rules of C++ say that the bool conversion takes precedence, which isn't what you want here. Adding an overload for 'const char*' removes the ambiguity.
Generally it's a good idea to only overload functions when the semantics of the function is the same no matter which overload is chosen, otherwise things like this happen.