diff --git a/include/predict.hpp b/include/predict.hpp index c96782b..395a6cb 100644 --- a/include/predict.hpp +++ b/include/predict.hpp @@ -16,8 +16,8 @@ namespace budget { struct predict_module { - void load(); - void handle(std::vector& args); + void load() const; + void handle(std::vector& args) const; }; template<> diff --git a/src/budget.cpp b/src/budget.cpp index 3b70283..f007ab5 100644 --- a/src/budget.cpp +++ b/src/budget.cpp @@ -104,7 +104,7 @@ constexpr bool disable_preloading() { struct module_loader { template - inline void operator()(){ + inline void operator()() const { if constexpr (needs_preloading) { Module module; module.preload(); diff --git a/src/predict.cpp b/src/predict.cpp index 24e6d23..97afbc8 100644 --- a/src/predict.cpp +++ b/src/predict.cpp @@ -88,13 +88,13 @@ void predict_overview(){ } // end of anonymous namespace -void budget::predict_module::load(){ +void budget::predict_module::load() const { load_accounts(); load_expenses(); load_earnings(); } -void budget::predict_module::handle(std::vector& args){ +void budget::predict_module::handle(std::vector& args) const { if(no_accounts()){ throw budget_exception("No accounts defined, you should start by defining some of them"); }