template statistics

Stanislav Blinov stanislav.blinov at gmail.com
Wed Jun 3 20:29:35 UTC 2020


On Wednesday, 3 June 2020 at 20:05:39 UTC, Walter Bright wrote:
> On 6/3/2020 7:58 AM, Stanislav Blinov wrote:
>> A good `writeln` would not call into C  at all.
>
> C's puts() is thread safe. No reason to not use it.

A thread-safe writeln would be threadsafe_writeln. Or, 
alternatively there would be a writeln and a 
not_threadsafe_writeln. No reason to pay for something you're not 
using. And still neither implementation would call into C, the OS 
is right there.
I guess this is where, in Phobos, one could use the output range 
format API with a custom sink. But that wouldn't help against all 
the unnecessary copying.

>> So it's OK, we're only missing a plain `writeln`.
>
> Doing the basic, common cases by going around the horn is not 
> good engineering.

On that, we're in agreement.


More information about the Digitalmars-d mailing list