Not sure if this library is still being worked on but I wanted to use some function objects that stored some state that mutated as the co-routine looped. However operator() has to be const or else I get the error error C3848: expression having type 'const signal_cv' would lose some const-volatile qualifiers in order to call 'auto signal_cv::operator ()<DC,Value>(Context &,Vars &)
The code reads:
template<typename Context, typename Vars>
auto operator()(Context &c, Vars &v)
{
cv.notify_all();
return c.do_next();
}
I can get around it with mutable members but I was just wondering if I've missed something, it's as designed or a VS issue?
I'm writing a function object that needs to check a state variable when it starts and if a condition is met simply continue on the pipeline. If the condition is false I need to issue an async operation (ASIO). Because I'm using async I need to return context.do_async(), however this means the return value in an auto operator() is different than earlier where it was context.do_next().