diff --git a/README.md b/README.md index bee9415..be3d25a 100644 --- a/README.md +++ b/README.md @@ -3,5 +3,15 @@ ThreadPool A simple C++11 Thread Pool implementation. -The "legacy" directory contains a version that does not use std::future -but a custom Result type that has essentially the same functionalty. +Basic usage: +```c++ +// create thread pool with 4 worker threads +ThreadPool pool(4); + +// enqueue and store future +auto result = pool.enqueue([](int answer) { return answer; }, 42); + +// get result from future +std::cout << result.get() << std::endl; + +```