Core: std_forward removed from CoWork.h as it breaks compilation in some cases

This commit is contained in:
Mirek Fidler 2024-09-18 11:45:46 +02:00
parent d7fd48271f
commit 8c82df7a92
4 changed files with 9 additions and 5 deletions

View file

@ -2,7 +2,7 @@
using namespace Upp;
struct Foo : Moveable< Foo, Comparable<Foo> > {
struct Foo : Moveable<Foo>, Comparable<Foo> {
String a;
int b;

View file

@ -1,4 +1,4 @@
description "Demonstration of common functions, methods and operators for concrete types";
description "Demonstration of common functions, methods and operators for concrete types\377";
uses
Core;

View file

@ -16,6 +16,10 @@ String qtf =
"[H6;b73;*7 $$6,3#07864147445237544204111237153677:section]"
;
#ifdef OUT
#undef OUT
#endif
#define OUT(x) out << x << '\n';
String toc;

View file

@ -183,7 +183,7 @@ class AsyncWork {
Ret2 ret;
template<class Function, class... Args>
void Do(Function&& f, Args&&... args) { co.Do([=]() { ret = f(std::forward<Args>(args)...); }); }
void Do(Function&& f, Args&&... args) { co.Do([=]() { ret = f(args...); }); }
const Ret2& Get() { return ret; }
Ret2 Pick() { return pick(ret); }
};
@ -192,7 +192,7 @@ class AsyncWork {
CoWork co;
template<class Function, class... Args>
void Do(Function&& f, Args&&... args) { co.Do([=]() { f(std::forward<Args>(args)...); }); }
void Do(Function&& f, Args&&... args) { co.Do([=]() { f(args...); }); }
void Get() {}
void Pick() {}
};
@ -203,7 +203,7 @@ class AsyncWork {
public:
template< class Function, class... Args>
void Do(Function&& f, Args&&... args) { imp.Create().Do(f, std::forward<Args>(args)...); }
void Do(Function&& f, Args&&... args) { imp.Create().Do(f, args...); }
void Cancel() { if(imp) imp->co.Cancel(); }
static bool IsCanceled() { return CoWork::IsCanceled(); }