mirror of
https://github.com/Expand-sys/CCash
synced 2025-12-16 16:12:14 +11:00
🐎 noexcept constructors
This commit is contained in:
parent
6599f47dcc
commit
36e2f6301f
2 changed files with 6 additions and 6 deletions
|
|
@ -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;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -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); }
|
||||||
Loading…
Reference in a new issue