Move the composition strategies into their own header

This commit is contained in:
Denis Blank 2018-03-12 08:05:06 +01:00
parent 3df06820ef
commit 49a097660b
4 changed files with 16 additions and 14 deletions

View File

@ -145,6 +145,11 @@ struct continuable_dispatcher {
}; };
} // namespace all } // namespace all
struct composition_strategy_all_tag {};
template <>
struct is_composition_strategy<composition_strategy_all_tag> // ...
: std::true_type {};
/// Finalizes the all logic of a given composition /// Finalizes the all logic of a given composition
template <> template <>
struct composition_finalizer<composition_strategy_all_tag> { struct composition_finalizer<composition_strategy_all_tag> {

View File

@ -160,6 +160,11 @@ struct continuable_dispatcher {
}; };
} // namespace any } // namespace any
struct composition_strategy_any_tag {};
template <>
struct is_composition_strategy<composition_strategy_any_tag> // ...
: std::true_type {};
/// Finalizes the any logic of a given composition /// Finalizes the any logic of a given composition
template <> template <>
struct composition_finalizer<composition_strategy_any_tag> { struct composition_finalizer<composition_strategy_any_tag> {

View File

@ -126,6 +126,11 @@ public:
}; };
} // namespace seq } // namespace seq
struct composition_strategy_seq_tag {};
template <>
struct is_composition_strategy<composition_strategy_seq_tag> // ...
: std::true_type {};
/// Finalizes the seq logic of a given composition /// Finalizes the seq logic of a given composition
template <> template <>
struct composition_finalizer<composition_strategy_seq_tag> { struct composition_finalizer<composition_strategy_seq_tag> {

View File

@ -47,22 +47,9 @@ namespace detail {
/// The namespace `composition` offers methods to chain continuations together /// The namespace `composition` offers methods to chain continuations together
/// with `all`, `any` or `seq` logic. /// with `all`, `any` or `seq` logic.
namespace composition { namespace composition {
struct composition_strategy_all_tag {}; template <typename T>
struct composition_strategy_any_tag {};
struct composition_strategy_seq_tag {};
template <typename T>
struct is_composition_strategy // ... struct is_composition_strategy // ...
: std::false_type {}; : std::false_type {};
template <>
struct is_composition_strategy<composition_strategy_all_tag> // ...
: std::true_type {};
template <>
struct is_composition_strategy<composition_strategy_any_tag> // ...
: std::true_type {};
template <>
struct is_composition_strategy<composition_strategy_seq_tag> // ...
: std::true_type {};
/// Adds the given continuation tuple to the left composition /// Adds the given continuation tuple to the left composition
template <typename... LeftArgs, typename... RightArgs> template <typename... LeftArgs, typename... RightArgs>