TBB Pipeline Compile Errors

TBB Pipeline Compile Errors

I am trying to build a TBB pipeline with the new syntax as described in the tutorial, using tbb:filter_t as belowFILE *fd tbb::filter_t f1( tbb::filter::serial_in_order, MyInputFunc(fd) );but it keeps throwing a compile error:tbb40_20120201oss/include/tbb/pipeline.h:416: error: passing const MyInputFunc as this argument of TextSlice* MyInputFunc::operator()(tbb::interface6::flow_control&) discards qualifiersIt works fine with the inheritance based old filter API. tbb::filter_t f1( tbb::filter::serial_in_order, MyInputFunc(fd) );

2 帖子 / 0 全新
最新文章
如需更全面地了解编译器优化,请参阅优化注意事项

Never mind looking at pipeline.h, I realized it requires const functions. Changing the operator() to const, fixed it.I would recommend updating the tutorial and documentation to please reflect that you expect consts.

发表评论

登录添加评论。还不是成员?立即加入