On Fri, Feb 16, 2018 at 10:22 AM, Peter Dimov via Boost < boost@lists.boost.org> wrote:
Steven Watanabe wrote:
The thing is, in most cases, the tuple type is chosen by Yap, not by the
user. Most of the time, users don't actually need to care what the tuple type is, either.
...
struct a_transform {
template<class T> auto operator()(terminal_tag, T&&t); // ... };
Right.
I'd guess that tag matching is a later addition, because it only works for simple cases. You can't do
auto operator()(any_expression_tag, T&&... t);
I'm don't understand what that would mean, exactly. What you can write
though is:
template
auto get_arity::operator()(expression_tag<kind>, T const&... t) const { return std::max( { yap::transform(t, get_arity{})... } );
}
I'm pretty sure you actually can write almost exactly this using the template I showed above. I'll verify that this is the case. That might make the example a lot easier to understand. Zach