std.experimental.logger logging function __LINE__ parameter type

Steven Schveighoffer schveiguy at gmail.com
Fri Jan 10 17:13:54 UTC 2020


On 1/10/20 11:56 AM, ric maicle wrote:
> I recently noticed that the type of __LINE__ argument in the 
> std.experimental.logger functions is 'int'. Shouldn't the argument type 
> be size_t since __LINE__ is type size_t?
> 
> Using DMD 2.090.0
> 
> ric

Only if you intend to have files with 2 billion+ lines?

But actually, it's probably good to change it.

It works because it's known at compile-time, so VRP will allow the 
implicit downcast.

-Steve


More information about the Digitalmars-d mailing list