Change Solver into template class to allow for non-integer results

This commit is contained in:
2025-05-16 23:54:59 +02:00
parent 26dfb379a2
commit 7ad1b01879
28 changed files with 164 additions and 95 deletions

View File

@@ -1,5 +1,5 @@
// Solutions to the Advent Of Code 2024.
// Copyright (C) 2024 Stefan Müller
// Copyright (C) 2024-2025 Stefan Müller
//
// This program is free software: you can redistribute it and/or modify it under
// the terms of the GNU General Public License as published by the Free Software
@@ -24,11 +24,13 @@
class TestContext
{
public:
void run(const std::unique_ptr<Solver>&& solver, const long long int expected1, const long long int expected2,
void run(const std::unique_ptr<Solver<long long, long long>>&& solver, const long long expected1,
const long long expected2, const std::vector<std::string>& inputPaths);
void run(const std::unique_ptr<Solver<long long, std::string>>&& solver, const long long expected1,
const std::string expected2, const std::vector<std::string>& inputPaths);
void runPart1(const std::unique_ptr<Solver<long long, long long>>&& solver, const long long expected,
const std::vector<std::string>& inputPaths);
void runPart1(const std::unique_ptr<Solver>&& solver, const long long int expected,
const std::vector<std::string>& inputPaths);
void runPart2(const std::unique_ptr<Solver>&& solver, const long long int expected,
void runPart2(const std::unique_ptr<Solver<long long, long long>>&& solver, const long long expected,
const std::vector<std::string>& inputPaths);
std::vector<std::string> getInputPaths() const;
std::vector<std::string> getExampleInputPaths() const;