/*
- * Copyright 2015 Facebook, Inc.
+ * Copyright 2016 Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
#include <boost/thread/barrier.hpp>
+#include <folly/Conv.h>
#include <folly/futures/Future.h>
#include <vector>
window(
input,
[](int i) { return makeFuture(i); },
- 2),
+ window_size),
0,
[](int sum, const Try<int>& b) {
return sum + *b;
fn(input, 4, 6);
}
{
- // empty inpt
+ // empty input
std::vector<int> input;
fn(input, 1, 0);
}
{
// int -> Future<Unit>
- auto res = reduce(
- window(
- std::vector<int>({1, 2, 3}),
- [](int i) { return makeFuture(); },
- 2),
- 0,
- [](int sum, const Try<Unit>& b) {
- EXPECT_TRUE(b.hasValue());
- return sum + 1;
- }).get();
+ auto res = reduce(window(std::vector<int>({1, 2, 3}),
+ [](int /* i */) { return makeFuture(); },
+ 2),
+ 0,
+ [](int sum, const Try<Unit>& b) {
+ EXPECT_TRUE(b.hasValue());
+ return sum + 1;
+ }).get();
EXPECT_EQ(3, res);
}
{