libgo
libgo copied to clipboard
引用coroutine.h编译就报错
系统是WIN10 编译器是MSVC 14.1 例子编译没问题,但是不知道为什么只要是自己新建的工程,引用coroutine.h编译就会报错 d:\source\libgo\libgo\context\fiber\context.h(12): error C4596: '{ctor}': illegal qualified name in member declaration https://i.imgur.com/aIDYGlu.png
FiberScopedGuard::FiberScopedGuard() { GetTlsContext() = ConvertThreadToFiber(nullptr); } FiberScopedGuard::~FiberScopedGuard() { ConvertFiberToThread(); GetTlsContext() = nullptr; }
改为
FiberScopedGuard() { GetTlsContext() = ConvertThreadToFiber(nullptr); } ~FiberScopedGuard() { ConvertFiberToThread(); GetTlsContext() = nullptr; }
就能正常编译了,但是不知道为什么在例子工程里不需要改