assert() vs. enforce(), invariant() vs. ... ?
Namespace
rswhite4 at googlemail.com
Fri Aug 30 11:20:13 PDT 2013
> Typedef was useful not for poking around new type with same
> properties - new name of existing type, but for non-trivial
> default value:
>
> typedef int myint = 1;
>
> void main()
> {
> myint my;
> assert(my is 1);
> }
>
> Alias does not provide this feature, so D hadn't become better
> with this depreciation (actually the opposite). Nor it had with
> delete operator depreciation for the replacement of destroy,
> which like in case with typedef, does not cover full old
> feature functionality (and functionality what destroy() does
> provide is useless in many cases). I consider both
> depreciations as mistakes.
Thanks for explanation. I agree that the deprecation of typedef
and delete is/was a mistake, and IMO the deprecation of scope and
the library fix scoped is the same mistake.
More information about the Digitalmars-d
mailing list