c++ - How can I return a value from a thread without using the future header? -


my current compiler doesn't support future header, , i'm unable update on android, compiler wrapped in app. because of this, decided try make own simple future class. have of laid out, can't figure out how return value thread (as seems beyond intended use). pass future class functor contains it's own return holder variable retrieved later, that's little limiting, because wanted pass have derived original functors class, , not function.

is there way achieve this? i'm assuming standard future header doesn't use black magic it. use "different version" of threads allow receive value back?

(it's not old not compatible threading, has issues future header reason)

thanks

i think writing own simple future class you're on right way. code like?

i'm not sure if understand statement:

i pass future class functor contains it's own return holder variable retrieved later, that's little limiting, because wanted pass have derived original functors class, , not function.

i wouldn't pass functor store variables values want return values thread. if want different return values derive classes simplefuture class.


Comments

Popular posts from this blog

java - WrongTypeOfReturnValue exception thrown when unit testing using mockito -

php - Magento - Deleted Base url key -

android - How to disable Button if EditText is empty ? -