+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) {
+ static_assert(
+ std::is_same<LeftValue, RightValue>::value,
+ "Generators may ony be combined if Values are the exact same type.");
+ return Chain(left.self(), right.self());
+}
+
+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) {
+ static_assert(
+ std::is_same<LeftValue, RightValue>::value,
+ "Generators may ony be combined if Values are the exact same type.");
+ return Chain(left.self(), std::move(right.self()));
+}
+
+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) {
+ static_assert(
+ std::is_same<LeftValue, RightValue>::value,
+ "Generators may ony be combined if Values are the exact same type.");
+ return Chain(std::move(left.self()), right.self());
+}
+
+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) {
+ static_assert(
+ std::is_same<LeftValue, RightValue>::value,
+ "Generators may ony be combined if Values are the exact same type.");
+ return Chain(std::move(left.self()), std::move(right.self()));
+}
+