Skip to content

Commit

Permalink
Constness
Browse files Browse the repository at this point in the history
  • Loading branch information
wichtounet committed Sep 28, 2023
1 parent 29f81dd commit a510f29
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions include/predict.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
namespace budget {

struct predict_module {
void load();
void handle(std::vector<std::string>& args);
void load() const;
void handle(std::vector<std::string>& args) const;
};

template<>
Expand Down
2 changes: 1 addition & 1 deletion src/budget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ constexpr bool disable_preloading() {

struct module_loader {
template<typename Module>
inline void operator()(){
inline void operator()() const {
if constexpr (needs_preloading<Module>) {
Module module;
module.preload();
Expand Down
4 changes: 2 additions & 2 deletions src/predict.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<std::string>& args){
void budget::predict_module::handle(std::vector<std::string>& args) const {
if(no_accounts()){
throw budget_exception("No accounts defined, you should start by defining some of them");
}
Expand Down

0 comments on commit a510f29

Please sign in to comment.