Projucer Live Build and std::unordered_map


After updating to juce 5.2, I gave Projucer live build feature a shot after a long time not experimenting with it.

With a simple (console) program that just instantiates an unordered_map<string, string> I get compilation errors saying “no template named equal_to”. Which shouldn’t arise since std::equal_to is supposed to be included by #include <unordered_map> and by default just calls the == operator.

Am I doing anything wrong in this program?

Unfortunately this is a known issue. It’s something to do with LLVM’s JIT engine and also occurs when trying to use std::function. We work around this in JUCE by using JUCE’s HashMap instead of unordered_map and this replacement for std::function.

Too bad because I intended to speed up some GUI work on an existing project with the help of the Projucer. I don’t have time to dig into classes replacement into the whole codebase at the moment.
Thanks for your help.

Do you know if this fix is compatible with juce 4.3.1? I haven’t signed up for 5.x yet, and proJucer does not like my template code that uses std::function.

The std::function replacement was added after the release of JUCE 5 so isn’t compatible with a JUCE 4 license. However if you’re only using it for prototyping and aren’t using it commercially in software that you release then you’re OK.