I am creating a game that lets the player enter input, changes some states, then checks if a \"goal value\" is true (obviously this description is muchly simplified), and I
Static expressions
(amendment to Macke's post)
When your expressions are known at compile time, you can use std::function. However, the performance might not be optimal.
You can automatically register test at compile-time and execute them at run-time with (presumambly) minimal runtime overhead, using C++11 templates and macros. A proof-of-concept implementation can be found here.
In the long run, a language feature named "Contracts" could do the job. (N4415, N4435, N4378) Today, there are various libraries available to support contract programming.