Subject: Re: [boost] [Fit] Formal review / Kris
From: Paul Fultz II (pfultz2_at_[hidden])
Date: 2016-03-20 16:29:08
On Sunday, March 20, 2016 at 10:44:45 AM UTC-5, Louis Dionne wrote:
> Paul Fultz II wrote
> > [...]
> > Yes, I have run a couple of local tests to test performance. I could
> > together some report to put in the documentation. Ideally. it would be
> > good to
> > have a comparison with other libraries as well. I haven't compared it
> > Hana yet, either, which would be a good idea. However, I do know that
> > implementation of `fit::conditional` is much faster than the
> > used for `overload_linearly` in Hana, but I haven't done a direct
> > comparison.
> > I'll try to add something like that. I think it will be useful.
> How so? The implementations are very similar, except Hana also allows
> for non-const function objects. I'd be grateful if you could provide a
> benchmark, perhaps I could improve Hana's implementation.
Actually looking at your implementation closer, I realized thats not the
I originally had an implementation where I ranked the overloads, and your
implementation looked similar to that when using `which`. However, after
looking at it closer, it won't ever instantiate the second function if the
first function is callable. Sorry for the confusion.
However, one notable difference though is that fit::conditional is SFINAE-
friendly, which makes it very composable. So in Fit, one can write
`fit::conditional(fit::conditional(f, g), h)` and it will work as the
equivalent of `fit::conditional(f, g, h)`. However, in Hana,
`hana::overload_linearly(hana::overload_linearly(f, g), h)` works as the
equivalent of `hana::overload_linearly(f, g)`(note the missing h). Of
this more of a philosophical difference between Fit and Hana, as Hana lacks
SFINAE-friendliness throughout the entire library and uses its own mechanism
to compose failures. I don't think the Fit library is incompatible with
> View this message in context:
> Sent from the Boost - Dev mailing list archive at Nabble.com.
> Unsubscribe & other changes:
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk