From df62abac5535660fdacdcc991255b3f28ea2a5e7 Mon Sep 17 00:00:00 2001 From: Istvan Haller Date: Fri, 6 Aug 2021 15:08:24 +0100 Subject: [PATCH] Added nodiscard --- src/backend/pagemap.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/backend/pagemap.h b/src/backend/pagemap.h index ccf262a..62c97fd 100644 --- a/src/backend/pagemap.h +++ b/src/backend/pagemap.h @@ -188,7 +188,7 @@ namespace snmalloc /** * Get the number of entries. */ - constexpr size_t num_entries() const + [[nodiscard]] constexpr size_t num_entries() const { if constexpr (has_bounds) { @@ -242,7 +242,7 @@ namespace snmalloc * Return the starting address corresponding to a given entry within the * Pagemap. Also checks that the reference actually points to a valid entry. */ - address_t get_address(const T& t) const + [[nodiscard]] address_t get_address(const T& t) const { address_t entry_offset = address_cast(&t) - address_cast(body); address_t entry_index = entry_offset / sizeof(T);