Boost logo

Boost :

Subject: Re: [boost] [odeint] Documentation comments
From: Mario Mulansky (mario.mulansky_at_[hidden])
Date: 2012-09-26 20:02:02


On Wednesday, September 26, 2012 06:42:09 PM John Bytheway wrote:
> On 25/09/12 22:38, Mario Mulansky wrote:
> > John Bytheway <jbytheway+boost_at_[hidden]> wrote:
> >> The more general idea of automatically dispatching to the right
> >> algebra is more dangerous, because for example it is entirely
> >> possible to have a type which is both a Fusion sequence and a Range
> >> (but with different semantics in each interpretation). So, I am not
> >> suggesting that (though I wouldn't argue against it either).
> >
> > This would be an edge case where explicit user definition is
> > required, but i think in 99% an algebra dispatcher would be
> > sufficient.
>
> On further reflection I thought of a particular case where this happens.
> Any std::pair<Iterator, Iterator> is both a Fusion Sequence and a Range,
> with very different semantics. Just something to consider.

True, one should be very defensive with automatically chosing the fusion
algebra. However, I like the idea of automatically choosing the array algebra
when possible, and I also still think the appropriate point to make this
decision would be a general algebra dispatcher.

Mario


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