diff options
| author | Jonathan Bradley <jcb@pikum.xyz> | 2025-05-28 17:11:25 -0400 |
|---|---|---|
| committer | Jonathan Bradley <jcb@pikum.xyz> | 2025-05-28 17:11:25 -0400 |
| commit | 41eec42394ad2df6ad5cd6d400e950d17184bb00 (patch) | |
| tree | 196299a17d69eb3163d6c95e29a4b65c9f4cf692 /pkbktarr.h | |
| parent | 5de82baf576996a85c9adc808f14d0c9f9cff3b3 (diff) | |
pkbktarr: handle: MAX + ==operator
Diffstat (limited to 'pkbktarr.h')
| -rw-r--r-- | pkbktarr.h | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -18,6 +18,18 @@ struct pk_bkt_arr_handle { unsigned int i : 8; }; +#if ! defined(__cplusplus) +#define pk_bkt_arr_handle_MAX ((struct pk_bkt_arr_handle){ .b = PK_BKT_ARR_HANDLE_B_MAX, .i = PK_BKT_ARR_HANDLE_I_MAX }) +#else +#define pk_bkt_arr_handle_MAX (pk_bkt_arr_handle{ .b = PK_BKT_ARR_HANDLE_B_MAX, .i = PK_BKT_ARR_HANDLE_I_MAX }) +constexpr struct pk_bkt_arr_handle pk_bkt_arr_handle_MAX_constexpr = pk_bkt_arr_handle_MAX; +inline constexpr bool +operator==(const pk_bkt_arr_handle &lhs, const pk_bkt_arr_handle &rhs) +{ + return lhs.b == rhs.b && lhs.i == rhs.i; +} +#endif + struct pk_bkt_arr { struct pk_membucket *bkt_buckets; struct pk_membucket *bkt_data; |
