bearophile <[email protected]> wrote:
Simen kjaeraas:
Not sure. This way is more explicit, and errors will be caught at
compile-time.
I see. But if a syntax is ugly and too much heavy, people (rightly)
don't use it... (This is why bounded values are good as builtins).
Of course. Now, aliases help a bit here, turning that into something
like:
alias Bounded!(int, 1, 5) myInt;
myInt[] myArr;
myArr ~= myInt( 1 );
I believe using an alias would be a good idea in most such cases, as
one's bound to write Bounded!(int,1,6) in a long program, and
wonder why it doesn't compile.
--
Simen