[challenge] Bounded types

Adam D. Ruppe destructionator at gmail.com
Sun Oct 10 15:56:04 PDT 2010


> I think scope(success) is an overkill here.

Yeah. It is in my brain due to writing a lot of database code with it:

db.query("START TRANSACTION");
scope(success) db.query("COMMIT");
scope(failure) db.query("ROLLBACK");


> Well done otherwise, looking forward for final version!

Thanks.

For future direction, I don't think the Type argument is actually needed to the
Bounded struct. It could determine it from the bounds.

So Bounded!(0, 255) it knows could be a ubyte, but Bounded!('A', 'Z') is a char.

Maybe the type param can be moved to the end, as an optional parameter. In most
cases, it should be able to figure it out on its own.


More information about the Digitalmars-d mailing list