17 #ifndef FOLLY_GEN_COMBINE_H_ 18 #error This file may only be included from folly/gen/Combine.h 22 #include <system_error> 24 #include <type_traits> 36 template <
class Container>
43 : container_(new Container(
std::
move(container))) {}
45 template <
class Value,
class Source>
53 "Only matching types may be interleaved");
58 const std::shared_ptr<const Container> container)
59 : source_(
std::
move(source)), container_(container) {}
61 template <
class Handler>
63 auto iter = container_->begin();
64 return source_.apply([&](
const Value&
value) ->
bool {
65 if (iter == container_->end()) {
80 template <
class Value2,
class Source,
class Gen = Generator<Value2, Source>>
82 return Gen(
std::move(source.self()), container_);
85 template <
class Value2,
class Source,
class Gen = Generator<Value2, Source>>
98 template <
class Container>
104 explicit Zip(Container container)
105 : container_(new Container(
std::
move(container))) {}
110 class Value2 = decltype(*
std::begin(*container_)),
111 class Result = std::tuple<
115 :
public GenImpl<Result, Generator<Value1, Source, Value2, Result>> {
122 const std::shared_ptr<const Container> container)
123 : source_(
std::
move(source)), container_(container) {}
125 template <
class Handler>
127 auto iter = container_->begin();
128 return (source_.apply([&](Value1
value) ->
bool {
129 if (iter == container_->end()) {
141 template <
class Source,
class Value,
class Gen = Generator<Value, Source>>
146 template <
class Source,
class Value,
class Gen = Generator<Value, Source>>
152 template <
class... Types1,
class... Types2>
154 -> std::tuple<Types1..., Types2...> {
158 template <
class... Types1,
class Type2>
161 return std::tuple_cat(
165 template <
class Type1,
class... Types2>
168 return std::tuple_cat(
172 template <
class Type1,
class Type2>
175 return std::make_tuple(std::forward<Type1>(t1), std::forward<Type2>(t2));
181 template <
class Tuple>
184 std::
get<1>(
std::forward<Tuple>(value)))) {
188 "Can only merge tuples of size 2");
190 std::get<0>(std::forward<Tuple>(value)),
191 std::get<1>(std::forward<Tuple>(value)));
202 Zip
zip(Source&& source) {
203 return Zip(std::forward<Source>(source));
const std::shared_ptr< const Container > container_
Interleave(Container container)
bool apply(Handler &&handler) const
bool apply(Handler &&handler) const
Gen compose(const GenImpl< Value, Source > &source) const
constexpr detail::Map< Move > move
auto begin(TestAdlIterable &instance)
auto add_to_tuple(std::tuple< Types1... > t1, std::tuple< Types2... > t2) -> std::tuple< Types1..., Types2... >
—— Concurrent Priority Queue Implementation ——
Generator(Source source, const std::shared_ptr< const Container > container)
void handler(int, siginfo_t *, void *)
Gen compose(const GenImpl< Value2, Source > &source) const
const Container::value_type & ConstRefType
Generator(Source source, const std::shared_ptr< const Container > container)
bool Value(const T &value, M matcher)
auto operator()(Tuple &&value) const -> decltype(add_to_tuple(std::get< 0 >(std::forward< Tuple >(value)), std::get< 1 >(std::forward< Tuple >(value))))
static const char *const value
Gen compose(GenImpl< Value2, Source > &&source) const
if(FOLLY_USE_SYMBOLIZER) add_library(folly_exception_tracer_base ExceptionTracer.cpp StackTrace.cpp) apply_folly_compile_options_to_target(folly_exception_tracer_base) target_link_libraries(folly_exception_tracer_base PUBLIC folly) add_library(folly_exception_tracer ExceptionStackTraceLib.cpp ExceptionTracerLib.cpp) apply_folly_compile_options_to_target(folly_exception_tracer) target_link_libraries(folly_exception_tracer PUBLIC folly_exception_tracer_base) add_library(folly_exception_counter ExceptionCounterLib.cpp) apply_folly_compile_options_to_target(folly_exception_counter) target_link_libraries(folly_exception_counter PUBLIC folly_exception_tracer) install(FILES ExceptionAbi.h ExceptionCounterLib.h ExceptionTracer.h ExceptionTracerLib.h StackTrace.h DESTINATION $
const std::shared_ptr< const Container > container_
const std::shared_ptr< const Container > container_
const Self & self() const
uint64_t value(const typename LockFreeRingBuffer< T, Atom >::Cursor &rbcursor)
const std::shared_ptr< const Container > container_
Gen compose(GenImpl< Value, Source > &&source) const