From 9d8417a8dc832755fdcbb25e156ae590f17933fd Mon Sep 17 00:00:00 2001 From: jeaye Date: Fri, 19 Jul 2024 12:58:42 -0700 Subject: [PATCH] Improve const-correctness for BppTree accessors --- include/bpptree/bpptree.hpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/bpptree/bpptree.hpp b/include/bpptree/bpptree.hpp index 7dfc317..c15c013 100644 --- a/include/bpptree/bpptree.hpp +++ b/include/bpptree/bpptree.hpp @@ -95,19 +95,19 @@ class BppTreeDetail { using IteratorType = IteratorDetail; public: - [[nodiscard]] size_t size() { + [[nodiscard]] size_t size() const { return tree_size; } - [[nodiscard]] constexpr size_t max_size() { + [[nodiscard]] constexpr size_t max_size() const { return max_size_v; } - [[nodiscard]] size_t depth() { + [[nodiscard]] size_t depth() const { return std::as_const(this->self()).dispatch([](auto const& root){ return static_cast(root->depth); }); } - [[nodiscard]] constexpr size_t max_depth() { + [[nodiscard]] constexpr size_t max_depth() const { return max_depth_v; }