From b572fc485a56c98db272566d18fa61540d711417 Mon Sep 17 00:00:00 2001 From: Chris-Sharpe Date: Fri, 11 Aug 2017 10:11:19 +0100 Subject: [PATCH] Code formatting in readme --- README.md | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index 9f0c2b6..0fc6043 100644 --- a/README.md +++ b/README.md @@ -25,35 +25,35 @@ Features: Sample usage -void first(int id) { - std::cout << "hello from " << id << '\n'; -} - - struct Second { - void operator()(int id) const { + void first(int id) { std::cout << "hello from " << id << '\n'; } -} second; -void third(int id, const std::string & additional_param) {} + struct Second { + void operator()(int id) const { + std::cout << "hello from " << id << '\n'; + } + } second; + + void third(int id, const std::string & additional_param) {} -int main () { + int main () { - ctpl::thread_pool p(2 /* two threads in the pool */); + ctpl::thread_pool p(2 /* two threads in the pool */); - p.push(first); // function + p.push(first); // function - p.push(third, "additional_param"); + p.push(third, "additional_param"); - p.push( [] (int id){ - std::cout << "hello from " << id << '\n'; -}); // lambda + p.push( [] (int id){ + std::cout << "hello from " << id << '\n'; + }); // lambda - p.push(std::ref(second)); // functor, reference + p.push(std::ref(second)); // functor, reference - p.push(const_cast<const Second &>(second)); // functor, copy ctor + p.push(const_cast(second)); // functor, copy ctor - p.push(std::move(second)); // functor, move ctor + p.push(std::move(second)); // functor, move ctor -} + }