Wordsearch Solver
|
This class can be used to check if a particular dictionary solver implementation exists, and create an instance of one with a particular dictionary. More...
#include <solver.hpp>
Public Member Functions | |
bool | has_solver (const std::string_view solver) const |
Check if a dictionary solver implementation called solver exists. More... | |
auto | solver_names () const -> decltype(ranges::views::all(solvers)) |
A view onto the names of available solvers. More... | |
template<class Words > | |
SolverDictWrapper | make (const std::string_view solver, Words &&dictionary) const |
Make a dictionary solver. More... | |
Private Attributes | |
std::vector< std::string > | solvers |
This class can be used to check if a particular dictionary solver implementation exists, and create an instance of one with a particular dictionary.
See example/example.cpp for how to use it
boost::hana::tuple
. Ie. I want to store the immutable data in a compile time data structure like a boost::hana::tuple
, but be able to query it using runtime parameters like std::string
s. As a result, this uses a std::vector<std::string>
and some filthy macros instead. bool solver::SolverDictFactory::has_solver | ( | const std::string_view | solver | ) | const |
Check if a dictionary solver implementation called solver
exists.
[in] | solver | The name of the dictionary solver implementation |
solver
with that name xists SolverDictWrapper solver::SolverDictFactory::make | ( | const std::string_view | solver, |
Words && | dictionary | ||
) | const |
Make a dictionary solver.
[in] | solver | Name of the dictionary solver implementation |
[in] | dictionary | List of words to use as a dictionary |
auto solver::SolverDictFactory::solver_names | ( | ) | const -> decltype(ranges::views::all(solvers)) |
A view onto the names of available solvers.
Return type leaks implementation details, I dislike it but am unsure how to avoid it