的boost ::背景库更新到版本v2和变化打破了我以往所有的代码依托的boost :: jump_fcontext()如何使用升压上下文V2
而且旧的boost :: jump_fcontext()是无在新的API中可用时间更长。新的boost :: context v2发生了很大的变化,我无法理解它。提供的示例并不能帮助我。
这里是程序结构的伪代码我试图用新的execute_context存档:
struct myctx
{
int var;
boost::context::execution_context fctx;
myctx()
: var(0), fctx("how to ctor")
{}
static void ctx_func(ctx_data * ptr) {
while(ptr->var++ < 1000) {
ptr->fctx("how to jump into main() myctx ??")
}
}
};
int main()
{
myctx mctx;
while(1)
mctx.fctx("how to jump into ctx_func() ??");
return 0;
}
如何更换与真正的C++那些字符串?我不明白什么是可能的参数boost::context::execution_context
我升压的使用::背景是,我保存在当前情况下为myctx和无序FASION切换到其他多个myctx的。有了boost :: jump_fcontext,这个过程相当清楚。
什么是“纯C++ 11”?而不是什么? int main()是纯的吗? –
我的意思是“纯C++ 11”,它使用API中所有新的C++ 11功能,如自动,元组和lambda表达式。 – JATothrim