From f3406754705e508f57768d3d0d8e457ff5b7620c Mon Sep 17 00:00:00 2001 From: Syndamia Date: Mon, 22 Apr 2024 15:43:49 +0300 Subject: [w8] Added exercise descriptions and solutions to ex 1-7 --- week08/Exercise7.h | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 week08/Exercise7.h (limited to 'week08/Exercise7.h') diff --git a/week08/Exercise7.h b/week08/Exercise7.h new file mode 100644 index 0000000..05d63c7 --- /dev/null +++ b/week08/Exercise7.h @@ -0,0 +1,33 @@ +#include + +class UserError { + char* className; + char* propertyName; + + void free(); + void copyFrom(const UserError& other); + + inline static int createdCount = 0; + +public: + UserError(); + ~UserError(); + UserError(const UserError& other); + UserError& operator=(const UserError& other); + UserError(UserError&& other); + UserError& operator=(UserError&& other); + + UserError(const char* className, const char* propertyName); + + friend std::ostream& operator<<(std::ostream& ostr, const UserError& right); + + static int GetCreatedCount(); +}; + +class NumberInput { + int value; + +public: + NumberInput(int min, int max); + int GetValue(); +}; -- cgit v1.2.3