Add solution to day 2
This commit is contained in:
@@ -1,9 +1,13 @@
|
||||
#include "AdventHelpers/AdventOfCodeSolution.h"
|
||||
|
||||
#define ENABLE_EXCEPTION_HANDLING 0
|
||||
|
||||
namespace AdventHelpers
|
||||
{
|
||||
void AdventOfCodeSolution::SolveAll() {
|
||||
#if ENABLE_EXCEPTION_HANDLING
|
||||
try {
|
||||
#endif
|
||||
auto* exampleInput = GetExampleInputFile();
|
||||
if (!exampleInput) {
|
||||
std::cerr << "Failed to load example input file." << std::endl;
|
||||
@@ -39,9 +43,11 @@ namespace AdventHelpers
|
||||
|
||||
AdventHelpers::InputFileHelper::destroy(exampleInput);
|
||||
AdventHelpers::InputFileHelper::destroy(problemInput);
|
||||
#if ENABLE_EXCEPTION_HANDLING
|
||||
}
|
||||
catch (...) {
|
||||
std::cerr << "An unexpected error occurred while solving the problems." << std::endl;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
} // namespace AdventHelpers
|
||||
Reference in New Issue
Block a user