|
|
|
|
|
by hornetblack
4807 days ago
|
|
Futures in C++11 are similar: int x = std::async([]()->int{
return 100;
});
std::cout << x.wait() << std::endl:
Which isn't as nice as closure. Go could probably benfit from having a standard futures tool. I guess something along the lines of: type Future {
Wait() interface{}
}
func newFuture(func interface{},
args ...interface{}) Future
|
|