X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=folly%2Ffibers%2FWhenN-inl.h;h=b7c126b29feef25c71d40ad332db057af086863e;hb=HEAD;hp=8b7fa6218067bc5078354eb089fab8693664d87d;hpb=ed8c80a0e0988e4ce687f51ca832a00e4a6b7930;p=folly.git diff --git a/folly/fibers/WhenN-inl.h b/folly/fibers/WhenN-inl.h index 8b7fa621..b7c126b2 100644 --- a/folly/fibers/WhenN-inl.h +++ b/folly/fibers/WhenN-inl.h @@ -1,5 +1,5 @@ /* - * Copyright 2017 Facebook, Inc. + * Copyright 2014-present Facebook, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -53,10 +53,6 @@ collectN(InputIterator first, InputIterator last, size_t n) { await([first, last, context](Promise promise) mutable { context->promise = std::move(promise); for (size_t i = 0; first != last; ++i, ++first) { -#ifdef __clang__ -#pragma clang diagnostic push // ignore generalized lambda capture warning -#pragma clang diagnostic ignored "-Wc++1y-extensions" -#endif addTask([ i, context, f = std::move(*first) ]() { try { auto result = f(); @@ -74,9 +70,6 @@ collectN(InputIterator first, InputIterator last, size_t n) { context->promise->setValue(); } }); -#ifdef __clang__ -#pragma clang diagnostic pop -#endif } }); @@ -114,10 +107,6 @@ collectN(InputIterator first, InputIterator last, size_t n) { await([first, last, context](Promise promise) mutable { context->promise = std::move(promise); for (size_t i = 0; first != last; ++i, ++first) { -#ifdef __clang__ -#pragma clang diagnostic push // ignore generalized lambda capture warning -#pragma clang diagnostic ignored "-Wc++1y-extensions" -#endif addTask([ i, context, f = std::move(*first) ]() { try { f(); @@ -135,9 +124,6 @@ collectN(InputIterator first, InputIterator last, size_t n) { context->promise->setValue(); } }); -#ifdef __clang__ -#pragma clang diagnostic pop -#endif } }); @@ -160,7 +146,7 @@ typename std::vector< type> inline collectAll(InputIterator first, InputIterator last) { typedef typename std::result_of< typename std::iterator_traits::value_type()>::type Result; - size_t n = std::distance(first, last); + size_t n = size_t(std::distance(first, last)); std::vector results; std::vector order(n); results.reserve(n); @@ -218,5 +204,5 @@ typename std::enable_if< assert(result.size() == 1); return std::move(result[0]); } -} -} +} // namespace fibers +} // namespace folly