Skip to content

Commit

Permalink
report base: add comparison operator
Browse files Browse the repository at this point in the history
  • Loading branch information
benedekkupper committed Oct 13, 2024
1 parent 54c07ed commit dc2c953
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions hid-rp/hid/report.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ class selector
struct id_base
{
report::id id;
bool operator==(const id_base& other) const = default;
};

/// @brief Base type for report storage structures.
Expand All @@ -106,6 +107,7 @@ struct base : public std::conditional_t<REPORT_ID != 0, id_base, std::monostate>
constexpr base()
requires(not has_id())
{}
bool operator==(const base& other) const = default;
};
static_assert(base<type::INPUT, 0>().selector() == selector(0x100));
static_assert(base<type::OUTPUT, 0x42>().selector() == selector(0x242));
Expand Down

0 comments on commit dc2c953

Please sign in to comment.