March 09, 2012 Can getHash be made pure? | ||||
|---|---|---|---|---|
| ||||
Still chugging away at implementing AA's in druntime proper, I reviewed the code for methods that can be marked pure but ran into a major road block: getHash() is not marked pure. That makes a lot of AA methods impure, that could, and probably should, be marked pure.
Is it possible to make TypeInfo.getHash() pure? AFAICT there's no good reason why it shouldn't be pure. Am I missing something?
T
--
The most powerful one-line C program: #include "/dev/tty" -- IOCCC
| ||||
March 09, 2012 Re: Can getHash be made pure? | ||||
|---|---|---|---|---|
| ||||
Posted in reply to H. S. Teoh | On 3/9/2012 1:54 PM, H. S. Teoh wrote:
> Still chugging away at implementing AA's in druntime proper, I reviewed
> the code for methods that can be marked pure but ran into a major road
> block: getHash() is not marked pure. That makes a lot of AA methods
> impure, that could, and probably should, be marked pure.
>
> Is it possible to make TypeInfo.getHash() pure? AFAICT there's no good
> reason why it shouldn't be pure. Am I missing something?
It should be const, pure, nothrow, @safe.
| |||
Copyright © 1999-2021 by the D Language Foundation
Permalink
Reply