skeleton of caching solver

Peter-- I'm not asking you to take the patch but rather would like to get your feedback. I learned C++ (literally) 20 years ago but have not used it for most of the time since then, so I am extremely rusty and also unfamiliar with modern C++ and also I don't even like OO programming. Anyway, let me know if this looks acceptable...