remake UTF-8 and I forgot what I have done in this commit

This commit is contained in:
EmsiaetKadosh
2025-03-11 18:37:34 +08:00
parent 7e63aa1217
commit a1d0f11032
32 changed files with 254 additions and 6 deletions
+5 -2
View File
@@ -17,7 +17,7 @@ public:
explicit Task(const Function<void(Task& self)>& func) : func(func) {}
explicit Task(Function<void(Task& self)>&& func) : func(std::move(func)) {}
void schedulePop(const bool pop) noexcept { reserved[0] = pop; }
bool scheduledPop() const noexcept { return reserved[0]; }
[[nodiscard]] bool scheduledPop() const noexcept { return reserved[0]; }
int pop() noexcept override {
schedulePop(true);
@@ -32,7 +32,10 @@ public:
void runAll() {
for (Task& task : tasks) {
task.func(task);
if (task.scheduledPop()) tasks.pop(&task);
if (task.scheduledPop()) {
task.schedulePop(false);
tasks.pop(&task);
}
}
}