Skip to content

Commit

Permalink
basic usage in readme
Browse files Browse the repository at this point in the history
  • Loading branch information
progschj committed May 22, 2013
1 parent 7e8ad09 commit f659749
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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<T> 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;

```

0 comments on commit f659749

Please # to comment.