D benchmark code review

logicchains jonathan.t.barnard at gmail.com
Sat Dec 14 02:45:39 PST 2013


On Saturday, 14 December 2013 at 09:09:21 UTC, Rikki Cattermole 
wrote:
> Personally for me its going a little far just having enum { 
> with multiple types being used as a value. But hey as long as 
> everyone can understand it, no problems!

I prefer untyped constants as they can be used as different types 
in different places, like #define'd constants in C. If constants 
are too strongly typed, it can lead to awkward situations such as 
in the Rust code where two constants for the same value were used 
in order to avoid a heap of ugly casts:
static StartRangei : u32 = 15;
static StartRangef : f64 = StartRangei as f64;


More information about the Digitalmars-d mailing list