digitalmars.D.learn - File.lockingBinaryWriter is not output range?
- Denis Feklushkin (16/16) Mar 19 2019 /+ dub.sdl:
- Vladimir Panteleev (7/13) Mar 19 2019 static
- Denis Feklushkin (5/19) Mar 19 2019 I add it ~everywhere for faster reproducing of cases.
- Vladimir Panteleev (7/17) Mar 19 2019 Not sure what you mean by this, because 1) it's not even doing
- Denis Feklushkin (2/8) Mar 19 2019 Looks like isOutputRange is not checks "put" method properly?
/+ dub.sdl: name "hello_world" +/ import std.algorithm, std.range, std.stdio; void main() { // lockingBinaryWriter: Returns an output range that locks the file and allows fast writing to it. // https://dlang.org/library/std/stdio/file.locking_binary_writer.html stdout.lockingBinaryWriter.put(cast(byte) 123); // works // But this assert is false: static assert(isOutputRange!(typeof(stdout.lockingBinaryWriter), byte)); } This blocks to user File as Stream for msgpack-d.
Mar 19 2019
On Tuesday, 19 March 2019 at 13:14:52 UTC, Denis Feklushkin wrote:/+ dub.sdl: name "hello_world" +/This doesn't seem necessary :)static assert(isOutputRange!(typeof(stdout.lockingBinaryWriter), byte));static assert(isOutputRange!(typeof(stdout.lockingBinaryWriter()), byte)); typeof(stdout.lockingBinaryWriter) is a function type. You need the ().
Mar 19 2019
On Tuesday, 19 March 2019 at 13:20:37 UTC, Vladimir Panteleev wrote:On Tuesday, 19 March 2019 at 13:14:52 UTC, Denis Feklushkin wrote:I add it ~everywhere for faster reproducing of cases./+ dub.sdl: name "hello_world" +/This doesn't seem necessary :)Ooops! Thanks! :-) /threadstatic assert(isOutputRange!(typeof(stdout.lockingBinaryWriter), byte));static assert(isOutputRange!(typeof(stdout.lockingBinaryWriter()), byte)); typeof(stdout.lockingBinaryWriter) is a function type. You need the ().
Mar 19 2019
On Tuesday, 19 March 2019 at 13:25:27 UTC, Denis Feklushkin wrote:On Tuesday, 19 March 2019 at 13:20:37 UTC, Vladimir Panteleev wrote:Not sure what you mean by this, because 1) it's not even doing anything if there are no dependencies on Dub packages, and 2) test cases should be self-contained and not have external dependencies anyway. If the test case can only be reproduced with some compiler switches, a shebang using rdmd (with --shebang for multiple switches) can be used to illustrate it.On Tuesday, 19 March 2019 at 13:14:52 UTC, Denis Feklushkin wrote:I add it ~everywhere for faster reproducing of cases./+ dub.sdl: name "hello_world" +/This doesn't seem necessary :)
Mar 19 2019
On Tuesday, 19 March 2019 at 13:14:52 UTC, Denis Feklushkin wrote:stdout.lockingBinaryWriter.put(cast(byte) 123); // works // But this assert is false: static assert(isOutputRange!(typeof(stdout.lockingBinaryWriter), byte)); }Looks like isOutputRange is not checks "put" method properly?
Mar 19 2019