Add future support, and fix returning of r-values

This commit is contained in:
Jason Turner
2015-01-06 14:41:36 -07:00
parent a32a180a06
commit 52d03a66b1
4 changed files with 51 additions and 0 deletions

View File

@@ -564,6 +564,25 @@ namespace chaiscript
return m;
}
/// Add a MapType container
/// http://www.sgi.com/tech/stl/Map.html
template<typename FutureType>
ModulePtr future_type(const std::string &type, ModulePtr m = ModulePtr(new Module()))
{
m->add(user_type<FutureType>(), type);
m->add(fun(&FutureType::valid), "valid");
m->add(fun(&FutureType::get), "get");
m->add(fun(&FutureType::wait), "wait");
return m;
}
}
}
}