Skip to content

Commit

Permalink
More concept style
Browse files Browse the repository at this point in the history
  • Loading branch information
d-frey committed Nov 28, 2024
1 parent c2686fa commit 156daf6
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions include/tao/pq/internal/aggregate.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,19 @@ namespace tao::pq::internal
template< typename T, std::size_t N >
inline constexpr bool check_aggregate_args = check_aggregate_args_impl< T, std::make_index_sequence< N > >;

template< typename T, std::size_t N = 1, bool = check_aggregate_args< T, N > >
inline constexpr std::size_t minimum_aggregate_args = N;
template< typename T, std::size_t N = 1 >
inline constexpr std::size_t minimum_aggregate_args = minimum_aggregate_args< T, N + 1 >;

template< typename T, std::size_t N >
inline constexpr std::size_t minimum_aggregate_args< T, N, false > = minimum_aggregate_args< T, N + 1 >;
requires check_aggregate_args< T, N >
inline constexpr std::size_t minimum_aggregate_args< T, N > = N;

template< typename T, std::size_t N = minimum_aggregate_args< T >, bool = check_aggregate_args< T, N > >
inline constexpr std::size_t count_aggregate_args = count_aggregate_args< T, N + 1 >;
template< typename T, std::size_t N = minimum_aggregate_args< T > >
inline constexpr std::size_t count_aggregate_args = N - 1;

template< typename T, std::size_t N >
inline constexpr std::size_t count_aggregate_args< T, N, false > = N - 1;
requires check_aggregate_args< T, N >
inline constexpr std::size_t count_aggregate_args< T, N > = count_aggregate_args< T, N + 1 >;

#define TAO_PQ_TIE( N, ... ) \
if constexpr( cnt == N ) { \
Expand Down

0 comments on commit 156daf6

Please sign in to comment.