opImplicitCast/opImplicitCastFrom
Janderson
ask at me.com
Sat Nov 1 17:34:16 PDT 2008
Andrei Alexandrescu wrote:
> typedef Bounded!(int, 1, 7, OnOverflow.nocheck) TyDice1;
> typedef Bounded!(char, 'a', 'z', OnOverflow.throwing) TyLowercaseAscii;
> ...
>
> I do agree that syntax may constitute an acceptance threshold, i.e.
> users may be willing to use a particular feature only if it also comes
> packaged with an easy-enough syntax.
>
>> Plus some syntax to locally enable/disable the bound checks (-release
>> disables them globally):
>>
>> unsafe(integral, bounds) {
>> // here both array bounds and integral bounds aren't checked
>> ...
>> }
>
> That would be more interesting because it can't be done conveniently via
> a library.
>
>
> Andrei
>
Will bounds include subtypes /subranges AKA ADA?
-Joel
More information about the Digitalmars-d
mailing list