From 8c82df7a92c03f5d2c8d421add4bddf0692e231e Mon Sep 17 00:00:00 2001 From: Mirek Fidler Date: Wed, 18 Sep 2024 11:45:46 +0200 Subject: [PATCH] Core: std_forward removed from CoWork.h as it breaks compilation in some cases --- reference/Common/Common.cpp | 2 +- reference/Common/Common.upp | 2 +- tutorial/CoreTutorial/Tutorial.cpp | 4 ++++ uppsrc/Core/CoWork.h | 6 +++--- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/reference/Common/Common.cpp b/reference/Common/Common.cpp index 1465890da..5d57b1d6c 100644 --- a/reference/Common/Common.cpp +++ b/reference/Common/Common.cpp @@ -2,7 +2,7 @@ using namespace Upp; -struct Foo : Moveable< Foo, Comparable > { +struct Foo : Moveable, Comparable { String a; int b; diff --git a/reference/Common/Common.upp b/reference/Common/Common.upp index c0e307977..5ee145ece 100644 --- a/reference/Common/Common.upp +++ b/reference/Common/Common.upp @@ -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; diff --git a/tutorial/CoreTutorial/Tutorial.cpp b/tutorial/CoreTutorial/Tutorial.cpp index 572403f97..bc0463e1a 100644 --- a/tutorial/CoreTutorial/Tutorial.cpp +++ b/tutorial/CoreTutorial/Tutorial.cpp @@ -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; diff --git a/uppsrc/Core/CoWork.h b/uppsrc/Core/CoWork.h index 4515b7e08..f2d7bd874 100644 --- a/uppsrc/Core/CoWork.h +++ b/uppsrc/Core/CoWork.h @@ -183,7 +183,7 @@ class AsyncWork { Ret2 ret; template - void Do(Function&& f, Args&&... args) { co.Do([=]() { ret = f(std::forward(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 - void Do(Function&& f, Args&&... args) { co.Do([=]() { f(std::forward(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)...); } + void Do(Function&& f, Args&&... args) { imp.Create().Do(f, args...); } void Cancel() { if(imp) imp->co.Cancel(); } static bool IsCanceled() { return CoWork::IsCanceled(); }