Live build and std::function


#1

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!
}

Live build: no template named 'function' in namespace 'std'
#2

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


#3

Stefan, yes, it is the same error.


#4

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.


#5

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


#6

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


#7

stefan.graenitz: Are there any known workarounds?


#8

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


#9

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


#10

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.