Skip to content

Commit

Permalink
Static assert that comparator provides a strict ordering
Browse files Browse the repository at this point in the history
Signed-off-by: Joseph Schuchart <[email protected]>
  • Loading branch information
devreal committed Nov 14, 2024
1 parent 393b4ee commit 6a6fa70
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ttg/ttg/constraint.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ namespace ttg {
using compare_t = Compare;
using base_t = ConstraintBase<Key>;

static_assert((!Compare{}(Ordinal{}, Ordinal{})), "Comparator must provide strict ordering.");

protected:
struct sequence_elem_t {
std::map<ttg::TTBase*, std::vector<key_type>> m_keys;
Expand Down

0 comments on commit 6a6fa70

Please sign in to comment.