From a797bb6718c9d799516d68329a0a4428eb8a7195 Mon Sep 17 00:00:00 2001 From: Mattrixwv Date: Fri, 28 Aug 2020 14:25:09 -0400 Subject: [PATCH] Moved Unsolved to it's own file --- Headers/Problem.hpp | 2 +- Headers/Unsolved.hpp | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 Headers/Unsolved.hpp diff --git a/Headers/Problem.hpp b/Headers/Problem.hpp index bbb1ff8..9a8454a 100644 --- a/Headers/Problem.hpp +++ b/Headers/Problem.hpp @@ -27,6 +27,7 @@ #include #include #include "Stopwatch.hpp" +#include "Unsolved.hpp" class Problem{ @@ -34,7 +35,6 @@ protected: const std::string description; //Holds the description of the problem mee::Stopwatch timer; //Used to determine your algorithm's run time bool solved; //Holds true after the problem has been solved - class Unsolved{}; //An exception class thrown if you try to access something before it has been solved public: //Constructors Problem() : solved(false){ diff --git a/Headers/Unsolved.hpp b/Headers/Unsolved.hpp new file mode 100644 index 0000000..bd66e83 --- /dev/null +++ b/Headers/Unsolved.hpp @@ -0,0 +1,24 @@ +//ProjectEuler/ProjectEulerCPP/headers/Unsolved.hpp +//Matthew Ellison +// Created: 08-28-20 +//Modified: 08-28-20 +//An exception class thrown if you try to access something before it has been solved + + +#ifndef UNSOLVED_HPP +#define UNSOLVED_HPP + + +#include + + +class Unsolved{ +private: + std::string message; +public: + Unsolved(){} + Unsolved(std::string message) : message(message){} +}; + + +#endif //UNSOLVED_HPP