What exactly does "@safe" mean?

Jonathan M Davis jmdavisProg at gmx.com
Sat Jun 1 15:13:54 PDT 2013


On Sunday, June 02, 2013 00:04:18 monarch_dodra wrote:
> On Saturday, 1 June 2013 at 21:45:18 UTC, Andrei Alexandrescu
> 
> wrote:
> > On 6/1/13 3:59 PM, monarch_dodra wrote:
> >> Yeah, overall, I'm confused as to what "@safe" means from an
> >> interface
> >> point of view :(
> > 
> > If you call the function from a program with memory integrity
> > and it returns, it hasn't compromised the memory integrity of
> > that program.
> > 
> > Homework: define memory integrity :o).
> > 
> > 
> > Andrei
> 
> OK. In a word, I guess that makes sense. I'll stick to that
> standard.
> 
> But there is still the "emplace" question: When I call "emplace"
> on a pointer to a built object, is does the program still have
> memory integrity? At the end of the call, was it emplace that
> compromised it? Was it the exact instance the "call was
> initialized"? 

Because the safety of the function depends on the caller, I'd say that it 
should be @system.

- Jonathan M Davis


More information about the Digitalmars-d mailing list