#ifndef FOLLY_GEN_CORE_H_
#error This file may only be included from folly/gen/Core.h
#endif
#include <type_traits>
#include <utility>
#include <folly/Portability.h>
FOLLY_PUSH_WARNING
FOLLY_GNU_DISABLE_WARNING(…)
namespace folly {
namespace gen {
template <class Candidate, class Expected>
class IsCompatibleSignature { … };
IsCompatibleSignature<Candidate, ExpectedReturn (ArgTypes...)>;
template <class Self>
struct FBounded { … };
template <class Self>
class Operator : public FBounded<Self> { … };
template <
class Left,
class Right,
class Composed = detail::Composed<Left, Right>>
Composed operator|(const Operator<Left>& left, const Operator<Right>& right) { … }
template <
class Left,
class Right,
class Composed = detail::Composed<Left, Right>>
Composed operator|(const Operator<Left>& left, Operator<Right>&& right) { … }
template <
class Left,
class Right,
class Composed = detail::Composed<Left, Right>>
Composed operator|(Operator<Left>&& left, const Operator<Right>& right) { … }
template <
class Left,
class Right,
class Composed = detail::Composed<Left, Right>>
Composed operator|(Operator<Left>&& left, Operator<Right>&& right) { … }
template <class Value, class Self>
class GenImpl : public FBounded<Self> { … };
template <
class LeftValue,
class Left,
class RightValue,
class Right,
class Chain = detail::Chain<LeftValue, Left, Right>>
Chain operator+(
const GenImpl<LeftValue, Left>& left,
const GenImpl<RightValue, Right>& right) { … }
template <
class LeftValue,
class Left,
class RightValue,
class Right,
class Chain = detail::Chain<LeftValue, Left, Right>>
Chain operator+(
const GenImpl<LeftValue, Left>& left, GenImpl<RightValue, Right>&& right) { … }
template <
class LeftValue,
class Left,
class RightValue,
class Right,
class Chain = detail::Chain<LeftValue, Left, Right>>
Chain operator+(
GenImpl<LeftValue, Left>&& left, const GenImpl<RightValue, Right>& right) { … }
template <
class LeftValue,
class Left,
class RightValue,
class Right,
class Chain = detail::Chain<LeftValue, Left, Right>>
Chain operator+(
GenImpl<LeftValue, Left>&& left, GenImpl<RightValue, Right>&& right) { … }
template <class Value, class Gen, class Handler>
typename std::enable_if<
IsCompatibleSignature<Handler, void(Value)>::value>::type
operator|(const GenImpl<Value, Gen>& gen, Handler&& handler) { … }
template <class Value, class Gen, class Handler>
typename std::
enable_if<IsCompatibleSignature<Handler, bool(Value)>::value, bool>::type
operator|(const GenImpl<Value, Gen>& gen, Handler&& handler) { … }
template <class Value, class Gen, class Op>
auto operator|(const GenImpl<Value, Gen>& gen, const Operator<Op>& op)
-> decltype(op.self().compose(gen.self())) { … }
template <class Value, class Gen, class Op>
auto operator|(GenImpl<Value, Gen>&& gen, const Operator<Op>& op)
-> decltype(op.self().compose(std::move(gen.self()))) { … }
namespace detail {
template <class First, class Second>
class Composed : public Operator<Composed<First, Second>> { … };
template <class Value, class First, class Second>
class Chain : public GenImpl<Value, Chain<Value, First, Second>> { … };
}
}
}
FOLLY_POP_WARNING