www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 19048] New: In core.internal.hash.hashOf to reduce template

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 puremagic.com
          Reporter: n8sh.secondary 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))`.

--
Jul 02 2018