#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wshadow"
-namespace folly { namespace gen {
+namespace folly {
+namespace gen {
/**
* ArgumentReference - For determining ideal argument type to receive a value.
inline detail::Batch batch(size_t batchSize) {
return detail::Batch(batchSize);
}
-
-}} // folly::gen
+} // gen
+} // folly
#pragma GCC diagnostic pop
*
* To learn more about this library, including the use of infinite generators,
* see the examples in the comments, or the docs (coming soon).
-*/
+ */
-namespace folly { namespace gen {
+namespace folly {
+namespace gen {
class Less {
public:
UnwrapOr unwrapOr(Fallback&& fallback) {
return UnwrapOr(std::forward<Fallback>(fallback));
}
-
-}} // folly::gen
+} // gen
+} // folly
#include <folly/gen/Base-inl.h>
}
};
-} // namespace detail
+} // namespace detail
// TODO(mcurtiss): support zip() for N>1 operands. Because of variadic problems,
// this might not be easily possible until gcc4.8 is available.
return Zip(std::forward<Source>(source));
}
-} // namespace gen
-} // namespace folly
+} // namespace gen
+} // namespace folly
template<class Container>
class Zip;
-} // namespace detail
+} // namespace detail
template<class Source2,
class Source2Decayed = typename std::decay<Source2>::type,
return Interleave(std::forward<Source2>(source2));
}
-} // namespace gen
-} // namespace folly
+} // namespace gen
+} // namespace folly
#include <folly/gen/Combine-inl.h>
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wshadow"
-namespace folly { namespace gen {
+namespace folly {
+namespace gen {
/**
* IsCompatibleSignature - Trait type for testing whether a given Functor
};
} // detail
-
-}} // folly::gen
+} // gen
+} // folly
#pragma GCC diagnostic pop
#pragma once
#define FOLLY_GEN_CORE_H_
-namespace folly { namespace gen {
+namespace folly {
+namespace gen {
template<class Value, class Self>
class GenImpl;
class Chain;
} // detail
-
-}} // folly::gen
+} // gen
+} // folly
#include <folly/gen/Core-inl.h>
| resplit(delim, keepDelimiter);
}
-} // !detail
+} // !detail
/**
* Generator which reads lines from a file.
inline auto byLine(const char* f, char delim = '\n')
-> decltype(byLine(File(f), delim)) { return byLine(File(f), delim); }
-}} // !folly::gen
+} // !gen
+} // !folly
namespace detail {
class FileReader;
class FileWriter;
-} // namespace detail
+} // namespace detail
/**
* Generator that reads from a file with a buffer of the given size.
S toFile(File file, std::unique_ptr<IOBuf> buffer) {
return S(std::move(file), std::move(buffer));
}
-
-}} // !folly::gen
+} // !gen
+} // !folly
#include <folly/gen/File-inl.h>
#include <folly/gen/Base.h>
-namespace folly { namespace gen {
+namespace folly {
+namespace gen {
namespace detail {
template <class Ops>
Sub sub(Sink sink) {
return Sub(std::move(sink));
}
-
-}} // !namespace folly::gen
+} // !namespace gen
+} // !namespace folly
#include <folly/gen/Parallel-inl.h>
#include <folly/MPMCPipeline.h>
#include <folly/experimental/EventCount.h>
-namespace folly { namespace gen { namespace detail {
+namespace folly {
+namespace gen {
+namespace detail {
/**
* PMap - Map in parallel (using threads). For producing a sequence of
return Gen(source.self(), pred_, nThreads_);
}
};
-
-}}} // namespaces
+} // namespace detail
+} // namespace gen
+} // namespace folly
#include <folly/gen/Core.h>
-namespace folly { namespace gen {
+namespace folly {
+namespace gen {
namespace detail {
template<class Predicate>
class PMap;
-} // namespace detail
+} // namespace detail
/**
* Run `pred` in parallel in nThreads. Results are returned in the
PMap pmap(Predicate pred = Predicate(), size_t nThreads = 0) {
return PMap(std::move(pred), nThreads);
}
-
-}} // namespaces
+} // namespace gen
+} // namespace folly
#include <folly/gen/ParallelMap-inl.h>
#pragma GCC diagnostic pop
-} // namespace detail
+} // namespace detail
-} // namespace gen
-} // namespace folly
+} // namespace gen
+} // namespace folly
class... Targets>
class SplitTo;
-} // namespace detail
+} // namespace detail
/**
* Split the output from a generator into StringPiece "lines" delimited by
return StreamSplitter<Callback>(delimiter, std::move(pieceCb), capacity);
}
-} // namespace gen
-} // namespace folly
+} // namespace gen
+} // namespace folly
#include <folly/gen/String-inl.h>
TestIntSeq& operator=(const TestIntSeq&) = delete;
};
-} // namespace
+} // namespace
TEST(Gen, NoGeneratorCopies) {
EXPECT_EQ(15, TestIntSeq() | sum);
size_t len(folly::StringPiece s) { return s.size(); }
-} // namespace
+} // namespace
BENCHMARK(StringResplitter_Big, iters) {
size_t s = 0;