Live build and std::function

Hi!

I use Live build mode , and seems that it cannot works with std::functions.
How can i fixed this?

void print_add(int i)  { std::cout << i << '\n'; }

TestJuceWithStdFunctionAudioProcessor::TestJuceWithStdFunctionAudioProcessor()
{
    std::function<void(int)> one = print_add;
    std::function<void(int)> another;
    one(123); // error!
    another = one; // error!
}
1 Like

Hi, thanks for reporting. I can reproduce this one and will have a look at it. Just to make sure, same error on your side?

Cheers
Stefan

Stefan, yes, it is the same error.

Ok, I couldn’t solve this one yet, but we’ll definitely keep it on the radar! Thanks again for providing a great small repro.

1 Like

Any news on this one?
I get the same, really easy to reproduve, all is needed is a std::function calback.

std::function<void()> fn = {};
fn(); <— error here

1 Like

Yes please. This error prevents me using the live build on a few of my projects…

1 Like

stefan.graenitz: Are there any known workarounds?

Is this an ignored issue?
ProJucer live builds looked so promising and could have been so impressive if, now it’s practically unusable.

2 Likes

+1 Just discovered this issue, would really help if this was fixed. The live build engine has been very useful in my workflow!

Sorry chaps, Stefan was our Live-coding boffin, but he’s been off doing other stuff recently and this is a really, really in-depth and difficult thing to fix! One of the team will try to take a look as soon as we’ve got some JUCE 5 features out of the way.