Boost logo

Boost Users :

Subject: Re: [Boost-users] [Fit] upcoming formal review for Boost.Fit
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2016-03-01 21:57:36


AMDG

On 02/28/2016 06:15 AM, Vicente J. Botet Escriba wrote:
> Le 27/02/2016 17:41, Steven Watanabe a écrit :
>>
>> constexpr infix_adaptor<plus_f> plus = {};
>> int r = 3 <plus> 2;
>>
>> This is clever idea, but I'd really like to
>> see an analysis of how it interacts with
>> operator precedence.
>>
>>
> You should consider the normal precedence for operator<() and
> operator>() and use parenthesis when you are not sure what will be the
> result ;-) There is no magic.
>
> <snip>
>
> P.S. Paul, maybe you can add something about this in the documentation
> of infix.
>

  That's all I was getting at. Sure, I
can work out what happens, but I'd be
happier if the documentation showed some
indication that the author had considered
the issue, and found (a) there's nothing
to worry about, it will always work correctly,
or (b) it can only cause problems in some
obscure circumstances. Also, if the user
makes a mistake, how confused can the
compiler get?

  I'd also like some explanation of how it
interacts with other kinds of trickiness:

- phoenix::_1 <plus> phoenix::_2
- BOOST_TEST(1 <plus> 2);

In Christ,
Steven Watanabe


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net