diff --git a/include/bank.hpp b/include/bank.hpp index 7c3d57f..427fa8c 100644 --- a/include/bank.hpp +++ b/include/bank.hpp @@ -25,7 +25,7 @@ public: { std::shared_lock lock{save_lock}; return users.try_emplace_l( - name, [](User &) {}, std::forward(init_pass)); + name, [](User &) {}, std::forward(init_pass)); } bool AdminAddUser(const std::string &attempt, std::string &&name, uint_fast32_t init_bal, std::string &&init_pass) { @@ -34,7 +34,7 @@ public: { std::shared_lock lock{save_lock}; state = users.try_emplace_l( - name, [](User &) {}, init_bal, std::forward(init_pass)); + name, [](User &) {}, init_bal, std::forward(init_pass)); } return state; } @@ -110,6 +110,7 @@ public: u.password = new_pass; } }); + return res; } void Save() @@ -153,7 +154,7 @@ public: user_save.close(); for (const auto &u : temp.getMemberNames()) { - users.try_emplace(u, temp[u]["balance"].asUInt(), std::forward(temp[u]["password"].asString())); + users.try_emplace(u, temp[u]["balance"].asUInt(), std::move(temp[u]["password"].asString())); } } }