
Ivan Matek wrote:
On Tue, Dec 3, 2024 at 2:56 AM Peter Dimov
mailto:pdimov@gmail.com > wrote: Ivan Matek wrote: If you find yourself invoking hash_append with {} repeatedly, something is probably not right.
where f is your flavor argument.
Yes, but then again I am passing f multiple times. I don't want it to sound like I am making a big deal out of this, I can just do something like(and I actually use this idiom a lot)
const auto append = [&] (const auto& val){hash_append (h, f, val);} and use that "partially applied" helper, in case I actually need to do hash_append multiple times.
I just thought it would be nice to add something for beginners and to save typing since docs recommend default_flavor.
Also I know bike-shedding about names is not fun, but did you consider naming it native_flavor? Might help people that are familiar with std::endian enums learn library better.
native_flavor would mean something different, even if it would be the same type right now. It would be guaranteed not to change. default_flavor is what's the current default, and can change in the future, at least in principle. Or in other words, native_flavor is "give me native" and default_flavor is "give me whatever, I don't care about specifics or portability."