Bug 16617 – toHash can not be a template method

Status
NEW
Severity
enhancement
Priority
P4
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2016-10-16T10:34:55Z
Last change time
2024-12-13T18:50:27Z
Assigned to
No Owner
Creator
Илья Ярошенко
Moved to GitHub: dmd#19200 →

Comments

Comment #0 by ilyayaroshenko — 2016-10-16T10:34:55Z
Making toHash method a template can significantly reduce template bloat for ndslices. In the same time language DMD FE does not allow to do it because, for example, the following toHash declaration is not recognised as toHash method: struct S { uint s; size_t toHash()() { return s; } // does not work :-( }
Comment #1 by robert.schadek — 2024-12-13T18:50:27Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/19200 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB