template <class F>
Future<Unit> times(const int n, F&& thunk) {
return folly::whileDo(
- [ n, count = folly::make_unique<std::atomic<int>>(0) ]() mutable {
+ [ n, count = std::make_unique<std::atomic<int>>(0) ]() mutable {
return count->fetch_add(1) < n;
},
std::forward<F>(thunk));