Code Safety Attributes
You will learn about the code safety attributes that a function provides in this lesson.
We'll cover the following...
@safe
, @trusted
, and @system
are about the code safety that a function provides. As with purity, the compiler infers the safety level of templates, delegates, anonymous functions, and auto
functions.
@safe functions
A class of programming errors involves corrupting data at unrelated locations in memory by writing at those locations unintentionally. Such errors are mostly due to mistakes made in using pointers and applying type casts.
@safe
functions ...