Template Struct partition_by

Struct Documentation

template<typename Pivot, template<typename, typename> class Rel, typename ...Ts>
struct partition_by

Partition a pack Ts... into pass / fail buckets.

Builds two typelists:

  • pass: elements T where Rel<Pivot, T>::value is true

  • fail: the remaining elements

Remark

The concatenation order of results is stable relative to the original order (within each bucket).

Template Parameters:
  • Pivot – The pivot type used by the relation.

  • Rel – A binary template Rel<L,R> exposing static constexpr bool value.

  • Ts – Elements to partition.

Public Types

using impl = detail::partition_by_impl<Pivot, Rel, detail::HTList<Ts...>>
using pass = typename impl::pass
using fail = typename impl::fail
using concat = typename detail::HTList<pass, fail>