Skip to content

Commit 5a8ca17

Browse files
committed
Reformated excessively long lines
1 parent 41355c0 commit 5a8ca17

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

ThreadPool.h

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ class ThreadPool {
2727
public:
2828
ThreadPool(size_t);
2929
template<class F, class... Args>
30-
auto enqueue(F&& f, Args&&... args) -> std::future<decltype(std::forward<F>(f)(std::forward<Args>(args)...))>;
30+
auto enqueue(F&& f, Args&&... args)
31+
-> std::future<decltype(std::forward<F>(f)(std::forward<Args>(args)...))>;
3132
~ThreadPool();
3233
private:
3334
friend class Worker;
@@ -69,15 +70,19 @@ ThreadPool::ThreadPool(size_t threads)
6970

7071
// add new work item to the pool
7172
template<class F, class... Args>
72-
auto ThreadPool::enqueue(F&& f, Args&&... args) -> std::future<decltype(std::forward<F>(f)(std::forward<Args>(args)...))>
73+
auto ThreadPool::enqueue(F&& f, Args&&... args)
74+
-> std::future<decltype(std::forward<F>(f)(std::forward<Args>(args)...))>
7375
{
7476
typedef decltype(std::forward<F>(f)(std::forward<Args>(args)...)) return_type;
7577

7678
// don't allow enqueueing after stopping the pool
7779
if(stop)
7880
throw std::runtime_error("enqueue on stopped ThreadPool");
7981

80-
auto task = std::make_shared< std::packaged_task<return_type()> >(std::bind(std::forward<F>(f), std::forward<Args>(args)...));
82+
auto task = std::make_shared< std::packaged_task<return_type()> >(
83+
std::bind(std::forward<F>(f), std::forward<Args>(args)...)
84+
);
85+
8186
std::future<return_type> res = task->get_future();
8287
{
8388
std::unique_lock<std::mutex> lock(queue_mutex);

0 commit comments

Comments
 (0)