Leaf should document whether specializing `leaf::match` is allowed
steveire opened this issue · comments
Stephen Kelly commented
It is possible to specialize match
in order to match on properties of error types other than .value
.
Consider that this makes it possible to match on the category of a std::error_code
, but this should be possible for any user-defined error type:
It should be documented whether this kind of specialization of matching is allowed.
Emil Dotchevski commented
The match<> api is currently overloaded but I have already changed that in my working branch. Now there will be several separate predicates: match<>
, match_value<>
(which matches on .value
), match_member<>
(which can match any data member, but requires C++17).