From 5eea5368fa0d4d5873472deaa60dabbc633552fd Mon Sep 17 00:00:00 2001 From: FrancoisCarouge Date: Mon, 24 Nov 2025 22:08:41 -0800 Subject: [PATCH] Compatibility: fix compiler warnings and errors --- source/matplot/core/axes_object.h | 2 ++ source/matplot/util/common.cpp | 4 ++-- source/matplot/util/common.h | 7 ++++--- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/source/matplot/core/axes_object.h b/source/matplot/core/axes_object.h index 51cb4317..232498c6 100644 --- a/source/matplot/core/axes_object.h +++ b/source/matplot/core/axes_object.h @@ -29,6 +29,8 @@ namespace matplot { explicit axes_object(axes_handle parent); + virtual ~axes_object() = default; + public: virtual double xmax(); virtual double xmin(); diff --git a/source/matplot/util/common.cpp b/source/matplot/util/common.cpp index 9b27f5a9..31475680 100644 --- a/source/matplot/util/common.cpp +++ b/source/matplot/util/common.cpp @@ -866,8 +866,8 @@ namespace matplot { // Initial calculations if (log) { - std::invalid_argument("Not implemented yet. The library does not " - "need that as it is."); + throw std::invalid_argument("Not implemented yet. The library does " + "not need that as it is."); } // Data range diff --git a/source/matplot/util/common.h b/source/matplot/util/common.h index 7d371e69..fd762a4a 100644 --- a/source/matplot/util/common.h +++ b/source/matplot/util/common.h @@ -605,9 +605,10 @@ namespace matplot { /// \brief Helper method for determining the whole array size. /// Required for caching inner vector's size. std::size_t calculate_size(const vector_2d &vec) { - return std::accumulate( - vec.begin(), vec.end(), (std::size_t)(0), - [](auto cnt, const auto &vec) { return cnt + vec.size(); }); + return std::accumulate(vec.begin(), vec.end(), (std::size_t)(0), + [](auto cnt, const auto &inner_vec) { + return cnt + inner_vec.size(); + }); } public: