Bug: Ambiguous operator String() + std::string()


#1

this used to work and was introduced quite recently. reproduction:

auto x = std::string() + String();

Cheers,
Ben


#2

@jules added an explicit overload to operator+ in https://github.com/WeAreROLI/JUCE/commit/4793cd3fb8efd0ea4680ef4a86e4a37c2b1c9c96.

@pixelpacker what do you expect x to be in your example? A juce::String or a std::string?

To be explicit (and avoid the ambiguity), you can re-write your example as:

auto x = String{std::string{}} + String{};

or

auto x = std::string{} + String{}.toStdString();