The review of std.hash package
Johannes Pfau
nospam at example.com
Thu Aug 9 06:02:53 PDT 2012
Am Thu, 09 Aug 2012 08:48:37 -0400
schrieb Andrei Alexandrescu <SeeWebsiteForEmail at erdani.org>:
> On 8/9/12 5:05 AM, Johannes Pfau wrote:
> > Well that's possible, but I don't like the template bloat it causes.
>
> What have you measured, and what is your dislike based upon?
What annoys me is that as long the function only supported arrays, it
didn't need templates _at all_. So template bloat for arrays = 0. But
adding range support means the version dealing with arrays now has to
be a template as well(which is probably a bug, can't overload template
and non template function) and will produce extra code for every array
type. I just think adding range support shouldn't cause the array code
to change in any way.
But that's why I said I don't like it, not that it's a show stopper.
The overhead is probably neglectable, but in theory it shouldn't be
there at all.
>
> The library function must be generic. Then users worried about
> bloating may use it with a limited number of types.
>
> A digest function only dealing with void[void[]] is unacceptable.
Sure I agree that range support is necessary, I just forgot to
implement it initially. I'm not against range support / ranges in
general / the template instances needed for ranges. I just dislike
that it affects the array implementation in this specific case.
More information about the Digitalmars-d
mailing list