Bug 10135 – core.bitop: btc, btr, btc is "pure" but have side effects

Status
RESOLVED
Resolution
INVALID
Severity
trivial
Priority
P2
Component
druntime
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-05-22T08:57:00Z
Last change time
2013-05-23T01:16:55Z
Assigned to
nobody
Creator
4denizzz

Comments

Comment #0 by 4denizzz — 2013-05-22T08:57:12Z
core.bitop: btc, btr, btc is "pure" but have side effects
Comment #1 by clugdbug — 2013-05-23T01:13:40Z
> core.bitop: btc, btr, btc is "pure" but have side effects What do you mean? They don't modify any globals.
Comment #2 by alex — 2013-05-23T01:16:55Z
Yes, they are pure per the D definition. Even if a function mutates the memory pointed to by a pointer given to the function, it is still pure because that pointer is considered an input. See: http://klickverbot.at/blog/2012/05/purity-in-d/