Boost logo

Boost :

Subject: Re: [boost] [yap] Review
From: Zach Laine (whatwasthataddress_at_[hidden])
Date: 2018-02-14 21:04:12


On Wed, Feb 14, 2018 at 2:44 PM, P F <pfultz2_at_[hidden]> wrote:

>
> If there are advantages to using mp_assign, maybe this extra noise in a
> few places is worth it. I still have no idea what the mp_assign advantages
> are though.
>
>
> The point is to be able to get rid of `::` at the beginning in
> `BOOST_YAP_USER_UNARY_OPERATOR_MEMBER(logical_not, ::user_expr)`. If the
> user forgets those, you need to have a clear way to tell the user they need
> to add them, because it may not be obvious from the compiler error without
> understanding the implementation details.
>
> One way to solve this is to avoid it altogether by not passing a template,
> which you can try to utilize something like mp_assign.
>
> Another possible solution may be to add a static_assert with a message
> like “you are passing a type instead of template, you may need to prepend
> :: to the parameter to this macro". I think you can use function
> overloading to distinguish between a type and a template, but I am not
> sure.
>

Ah, I get it now, thanks.

I think I'd rather document better that the :: is required, as opposed to
doing more template chicanery. This is both because I want to keep compile
times low, and because I don't want to make something that might be brittle
in ways I don't fully understand. I'm a metaprogrammer of only moderate
skill.

Zach


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk