Closed lich426 closed 9 months ago
could you create pr directly?
could you create pr directly?
Maybe as a new third party entry?
could you create pr directly?
I haven't tested it on iOS and Linux yet, so I'm not sure if it's compatible with them. Could you please test this code?
I think you can create PR to check compiling by github ci firstly.
#include <experimental/coroutine>
==> #include <coroutine>
std::experimental
==> std
could you create pr directly?
I haven't tested it on iOS and Linux yet, so I'm not sure if it's compatible with them. Could you please test this code?
tested osx,ios,wasm worked without any additional compiler flags
Edit: since axmol c++ standard is 20, visual studio 2022 c++20 also don't require any additional compiler flags
I referred to the source code here
C++ compiler with Coroutines TS support
Is it possible to test on another platform?
ActionCoroutine.h
```c++ #ifndef __ACTION_CCCOROUTINE_ACTION_H__ #define __ACTION_CCCOROUTINE_ACTION_H__ #include "2d/Action.h" #includeActionCoroutine.cpp
```c++ #include "ActionCoroutine.h" NS_AX_BEGIN Coroutine::Coroutine(Coroutine&& rhs) noexcept : _handle(rhs._handle) { rhs._handle = nullptr; } Coroutine::~Coroutine() { if (_handle) { _handle.destroy(); } } Coroutine& Coroutine::operator=(Coroutine&& rhs) noexcept { if (this != std::addressof(rhs)) { _handle = rhs._handle; rhs._handle = nullptr; } return *this; } Action* Coroutine::currentAction() const noexcept { return _handle.promise().currentAction(); } bool Coroutine::isDone() const { return _handle && _handle.done(); } bool Coroutine::moveNext() const { if (_handle) { _handle.promise().resume(); return !_handle.done(); } return false; } ActionCoroutine* ActionCoroutine::create(Coroutine&& coroutine) { auto ret = new (std::nothrow) ActionCoroutine(); if (ret && ret->initWithCoroutine(std::forward