MultipleResponses.visit

This is primarily for testing. It is your way of getting to the response.

Let's say you wanted to test that one holding a Redirection and a string actually holds a string, by name of "test":

auto valueToTest = your_test_function();

valueToTest.visit(
	(Redirection r) { assert(0); }, // got a redirection instead of a string, fail the test
	(string s) { assert(s == "test"); } // right value, go ahead and test it.
);
struct MultipleResponses(T...)
void
visit
(
Handlers...
)
(
Handlers handlers
)

Meta

History

Was horribly broken until June 16, 2022. Ironically, I wrote it for tests but never actually tested it. It tried to use alias lambdas before, but runtime delegates work much better so I changed it.