January 11, 2020 std.experimental.logger logging function __LINE__ parameter type | ||||
---|---|---|---|---|
| ||||
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 |
January 10, 2020 Re: std.experimental.logger logging function __LINE__ parameter type | ||||
---|---|---|---|---|
| ||||
Posted in reply to ric maicle | 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
|
Copyright © 1999-2021 by the D Language Foundation