
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@gmail.com> 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