diff --git a/include/transaction.h b/include/transaction.h index 3544a48..ee407e0 100644 --- a/include/transaction.h +++ b/include/transaction.h @@ -9,7 +9,7 @@ struct Transaction uint32_t amount = 0; time_t time = 0; - Transaction(); - 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); + Transaction() noexcept; + 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) noexcept; }; diff --git a/src/transaction.cpp b/src/transaction.cpp index 5d45af7..ebf35ef 100644 --- a/src/transaction.cpp +++ b/src/transaction.cpp @@ -1,5 +1,5 @@ #include "transaction.h" -Transaction::Transaction() = 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) : from(from_str), to(to_str), amount(amount) { time = std::time(NULL); } \ No newline at end of file +Transaction::Transaction() noexcept = default; +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) noexcept : from(from_str), to(to_str), amount(amount) { time = std::time(NULL); } \ No newline at end of file