DIP33: A standard exception hierarchy
Dicebot
m.strashun at gmail.com
Wed Apr 3 07:38:58 PDT 2013
On Wednesday, 3 April 2013 at 14:32:59 UTC, Steven Schveighoffer
wrote:
> I wish there was a way to say "this data is unchecked" or "this
> data is checked and certified to be correct" when you call a
> function. That way you could run the in contracts on
> user-specified data, even with asserts turned off, and avoid
> the checks in release code when the data has already proven
> valid.
>
> -Steve
But you can. It is not much different from Range vs SortedRange,
type systems exists exactly to solve such issues. Using UDA is
probably even more elegant, but that is implementation details.
And it is one of big improvements both on safety and performance
side you can get from using strongly typed languages in network
services.
More information about the Digitalmars-d
mailing list