mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-15 14:16:07 -06:00
Core: std_forward removed from CoWork.h as it breaks compilation in some cases
This commit is contained in:
parent
d7fd48271f
commit
8c82df7a92
4 changed files with 9 additions and 5 deletions
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
using namespace Upp;
|
||||
|
||||
struct Foo : Moveable< Foo, Comparable<Foo> > {
|
||||
struct Foo : Moveable<Foo>, Comparable<Foo> {
|
||||
String a;
|
||||
int b;
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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(); }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue