🐎 noexcept constructors

This commit is contained in:
EntireTwix 2021-07-10 20:01:05 -07:00
parent 6599f47dcc
commit 36e2f6301f
2 changed files with 6 additions and 6 deletions

View file

@ -9,7 +9,7 @@ struct Transaction
uint32_t amount = 0; uint32_t amount = 0;
time_t time = 0; time_t time = 0;
Transaction(); Transaction() noexcept;
Transaction(const std::string &from_str, const std::string &to_str, uint32_t amount, time_t time); Transaction(const std::string &from_str, const std::string &to_str, uint32_t amount, time_t time) noexcept;
Transaction(const std::string &from_str, const std::string &to_str, uint32_t amount); Transaction(const std::string &from_str, const std::string &to_str, uint32_t amount) noexcept;
}; };

View file

@ -1,5 +1,5 @@
#include "transaction.h" #include "transaction.h"
Transaction::Transaction() = default; Transaction::Transaction() noexcept = default;
Transaction::Transaction(const std::string &from_str, const std::string &to_str, uint32_t amount, time_t time_val) : from(from_str), to(to_str), amount(amount), time(time_val) {} Transaction::Transaction(const std::string &from_str, const std::string &to_str, uint32_t amount, time_t time_val) noexcept : from(from_str), to(to_str), amount(amount), time(time_val) {}
Transaction::Transaction(const std::string &from_str, const std::string &to_str, uint32_t amount) : from(from_str), to(to_str), amount(amount) { time = std::time(NULL); } Transaction::Transaction(const std::string &from_str, const std::string &to_str, uint32_t amount) noexcept : from(from_str), to(to_str), amount(amount) { time = std::time(NULL); }