Boost logo

Boost :

From: Eric Niebler (eric_at_[hidden])
Date: 2008-03-20 21:17:34

Larry Evans wrote:
> However, I'd imagine some people would want
> this restricted to just two elements, which could be
> done with something like:
> And now, if size<Args>::value is
> restricted to the Arity in
> tag_arity<shift_right,Arity> then it
> would be restricted to 2.

Users may very well want to restrict tag::plus to arity 2 *in their
domain*, but they shouldn't be foisting that decision on other consumers
of Proto. The best way to ensure that expressions have the arity you
expect is to encode that in the grammar for your domain, and check it
with proto::matches.

Eric Niebler
Boost Consulting

Boost list run by bdawes at, gregod at, cpdaniel at, john at