mirror of
https://bitbucket.org/Mattrixwv/projecteulercpp.git
synced 2025-12-06 17:13:59 -05:00
Changed exception to Unsolved to fit with naming convention
This commit is contained in:
@@ -33,7 +33,7 @@ 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
|
||||
class Unsolved{}; //An exception class thrown if you try to access something before it has been solved
|
||||
public:
|
||||
//Constructors
|
||||
Problem() : solved(false){
|
||||
@@ -48,9 +48,17 @@ public:
|
||||
return description;
|
||||
}
|
||||
virtual std::string getTime(){
|
||||
//If the problem hasn't been solved throw an exception
|
||||
if(!solved){
|
||||
throw Unsolved();
|
||||
}
|
||||
return timer.getStr();
|
||||
}
|
||||
virtual mee::Stopwatch getTimer(){
|
||||
//If the problem hasn't been solved throw an exception
|
||||
if(!solved){
|
||||
throw Unsolved();
|
||||
}
|
||||
return timer;
|
||||
}
|
||||
//Reset the problem so it can be run again
|
||||
|
||||
Reference in New Issue
Block a user