ecrypa

Results 26 comments of ecrypa

## Summary This generalization of `fold_left` seems to work, but I do not like it. I will concisely try to explain my dislike. Then I turn back to `bind`-free composition...

Wow! Thanks a lot for your excellent explanations. I very much appreciate the time you are spending to teach me these things. While your explanations are _extremely_ useful for me,...

I start to feel more confident about the application of these metaprogramming techniques. I am looking forward to your comments to this latest approach. By the way: Should I close-and-open,...

> > We should be able to preserve SFINAE-friendlyness by simple pattern matching. > > Unfortunately, [you can't do that in general](https://godbolt.org/z/xggnhN). What an [inconsistent behavior of compilers](https://godbolt.org/z/vAOJ9P) here! Clang...

Benchmarks are promising ([Clang 8](https://ecrypa.github.io/metal-benchmark/min_element_clang8_v4_v14_bestof/), [GCC 9](https://ecrypa.github.io/metal-benchmark/min_element_gcc9_v4_v14_bestof/)). The winner [metal::v14::min_element](https://github.com/ecrypa/metal/blob/9fadd0c9ef2562ee0eb0f7deed63a7ef824c0af3/include/metal/list/min_element.v14.fast_dcall.hpp#L29) (similar to the version of this PR) is based on the new helper [dcall](https://github.com/ecrypa/metal/blob/9fadd0c9ef2562ee0eb0f7deed63a7ef824c0af3/include/metal/detail/sfinae.hpp#L79). If there are no SFINAE troubles...

> Just wondering, what happens if we get rid of `class... _` in the definition of `combiner`? I had once introduced that pack in order to improve the performance by...

> Without measurable advantage I classified that empty-pack trick as premature optimization. Just to back this up: [here](https://ecrypa.github.io/metal-benchmark/min_element_clang9_type_count/time.html) are the benchmarks using Clang 9 (see v11, v12, v13, and v14...

> Do consider contributing that to `metaben.ch`, I have opened an issue there in order to share that idea.

I like how this is boiling down to a two-liner (after some [crazy](https://github.com/ecrypa/metal/blob/22844ee3eb780a8539a707a1fc088c839772795a/include/metal/list/min_element.v7.alias_fasttrack.hpp#L20) [intermediate](https://github.com/ecrypa/metal/blob/22844ee3eb780a8539a707a1fc088c839772795a/include/metal/list/min_element.v8.foldlike.hpp#L46) [attempts](https://github.com/ecrypa/metal/blob/22844ee3eb780a8539a707a1fc088c839772795a/include/metal/list/min_element.v10.foldlike_indirection.hpp#L46)). Latest benchmarks of selected versions: - [Clang 9](https://ecrypa.github.io/metal-benchmark/min_element_clang9_v4_v15_bestof/) - [GCC 9](https://ecrypa.github.io/metal-benchmark/min_element_gcc9_v4_v15_bestof/)

> Benchmarks look pretty sweet! Those extra 30 ms on a list with 1000 elements definitely don't seem worth the pile of code that fast tracking requires. The most efficient...