www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - std.experimental.logger logging function __LINE__ parameter type

reply ric maicle <rmaicle gmail.com> writes:
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
Jan 10 2020
parent Steven Schveighoffer <schveiguy gmail.com> writes:
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
Jan 10 2020