obliterate

qznc qznc at web.de
Wed Nov 13 01:56:04 PST 2013


On Wednesday, 13 November 2013 at 00:33:17 UTC, Andrei 
Alexandrescu wrote:
> Hello,
>
>
> I will soon get to work on typed allocators; I figured there 
> will be some issues percolating to untyped allocators that will 
> require design changes (hopefully minor).
>
> For starters, I want to define a function that "obliterates" an 
> object, i.e. makes it almost surely unusable and not obeying 
> its own invariants. At the same time, that state should be 
> entirely reproducible and memory-safe.

> * floating point numbers: NaN, or some ridiculous value like 
> F.max / 2?

NaN would be semantically the right thing and there even is the 
concept of "signaling NaNs". I do not know how it works out in 
practice, though.

http://en.wikipedia.org/wiki/NaN#Signaling_NaN


More information about the Digitalmars-d mailing list