PrevUpHomeNext

esv::deferred


The protection of wild animals is protection of earth.

esv::deferred

esv::deferred is used to create deferred std::future thread. Unlike std::async which takes a parameter to indicate async or deferred, esv::deferred is always in deferred mode.

esv::deferred is based on std::async, that esv::deferred will call std::async.

c++ example

#include <esvcpp/core.hpp>
#include <esvcpp/thread.hpp>

int main()
{
	std::future<void()> f1 = esv::deferred([] {esv::print("Hello!");});
	auto f2 = esv::deferred([] {esv::print("c++!");});
	f1.wait();
	f2.wait();
}

See Also

esv::async

esv::ydzs

esv::mutex0~9

esv::print


PrevUpHomeNext

esv::print