2
私はここですでに答えられた質問を見つけることができなかったのですが、lambdasを使わずにcoroutine2 libをうまく使用していれば助けになります。 私の問題、sumarized:lambdaなしのboost coroutine2の使用
class worker {
...
void import_data(boost::coroutines2::coroutine
<boost::variant<long, long long, double, std::string> >::push_type& sink) {
...
sink(stol(fieldbuffer));
...
sink(stod(fieldbuffer));
...
sink(fieldbuffer); //Fieldbuffer is a std::string
}
};
私はその場所にそれぞれ得られた値を入れるのタスクを持っている別のクラス、内側からコルーチンとしてこれを使用するので、私は、オブジェクトをインスタンス化しようとした:
worker _data_loader;
boost::coroutines2::coroutine<boost::variant<long, long long, double, string>>::pull_type _fieldloader
(boost::bind(&worker::import_data, &_data_loader));
それは文句を言わないのコンパイル:
/usr/include/boost/bind/mem_fn.hpp:342:23:
error: invalid use of non-static member function of type
‘void (worker::)(boost::coroutines2::detail::push_coroutine<boost::variant<long int, long long int, double, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >&)’
誰かがこの問題にどの光を当てますか?