[Issue 19048] New: In core.internal.hash.hashOf to reduce template bloat remove `auto ref` when it's not needed
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Mon Jul 2 15:50:37 UTC 2018
https://issues.dlang.org/show_bug.cgi?id=19048
Issue ID: 19048
Summary: In core.internal.hash.hashOf to reduce template bloat
remove `auto ref` when it's not needed
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: enhancement
Priority: P1
Component: druntime
Assignee: nobody at puremagic.com
Reporter: n8sh.secondary at hotmail.com
Reduce template proliferation by not using `auto ref` unnecessarily. Scalars,
dynamic arrays, raw pointers, delegates, objects, and associative arrays don't
need to be passed by reference. Additionally by adding `const` where we know
it's legal we can cause IFTI to produce fewer distinct instantiations. For
instance we can avoid having separate template instantiations for `hashOf(const
int(1))` and `hashOf(int(1))`.
--
More information about the Digitalmars-d-bugs
mailing list