Template to determine if hook provides function called when error is set.
struct Hook { static string lastErr; static void onErrorSet(E)(auto ref E err) { lastErr = err; } } static assert(hasOnErrorSet!(Hook, string)); auto res = err!(int, Hook)("foo"); assert(res.hasError); assert(Hook.lastErr == "foo");
See Implementation
Template to determine if hook provides function called when error is set.