libgo icon indicating copy to clipboard operation
libgo copied to clipboard

引用coroutine.h编译就报错

Open xermao opened this issue 5 years ago • 1 comments

系统是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

xermao avatar Jun 11 '19 19:06 xermao

FiberScopedGuard::FiberScopedGuard() { GetTlsContext() = ConvertThreadToFiber(nullptr); } FiberScopedGuard::~FiberScopedGuard() { ConvertFiberToThread(); GetTlsContext() = nullptr; }

改为 FiberScopedGuard() { GetTlsContext() = ConvertThreadToFiber(nullptr); } ~FiberScopedGuard() { ConvertFiberToThread(); GetTlsContext() = nullptr; } 就能正常编译了,但是不知道为什么在例子工程里不需要改

xermao avatar Jun 12 '19 06:06 xermao