Achieve harmony between man and nature.
esv::async is used to create asynchronous std::future thread. Unlike std::async, esv::async is always in async mode: std::launch::async. If the operating system or runtime environment does not support asynchronous thread model, esv::async prefers crash, not continue creating a non-asynchronous thread.
esv::async is based on std::async, that esv::async will call std::async.
#include <esvcpp/thread.hpp> #include <esvcpp/core.hpp> int main() { std::future<void()> f1 = esv::async([] {esv::print("Hello c++!");}); auto f2 = esv::async([] {esv::print("c++ Hello!");}); }