Re: std.container ranges

2011-10-31 Thread Tobias Pankrath
Jonathan M Davis wrote: find allows you to do that just fine, and such a remove function would simply be duplicating its functionality. But this thread serves as a proof that it is not obvious and something like containers should be obvious to use. Deleting an element with a certain value

Re: std.container ranges

2011-10-31 Thread Dmitry Olshansky
On 31.10.2011 11:16, Tobias Pankrath wrote: Jonathan M Davis wrote: find allows you to do that just fine, and such a remove function would simply be duplicating its functionality. But this thread serves as a proof that it is not obvious and something like containers should be obvious to

Re: std.container ranges

2011-10-31 Thread Jonathan M Davis
On Monday, October 31, 2011 13:16:11 Dmitry Olshansky wrote: On 31.10.2011 11:16, Tobias Pankrath wrote: Jonathan M Davis wrote: find allows you to do that just fine, and such a remove function would simply be duplicating its functionality. But this thread serves as a proof that

Re: [beginner] Why nothing is printed to stdout ?

2011-10-31 Thread Frédéric Galusik
Le Sun, 30 Oct 2011 16:44:20 -0400, Nick Sabalausky a écrit : Frédéric Galusik fr...@salixosnospam.org wrote in message news:j8j77l$pfv$1...@digitalmars.com... Hi, Can someone give me a clue on why nothing is printed to stdout ? I wish a list of files with their size. code: // import

Re: [beginner] Why nothing is printed to stdout ?

2011-10-31 Thread Frédéric Galusik
Le Mon, 31 Oct 2011 00:55:58 +0400, Dmitry Olshansky a écrit : On 30.10.2011 14:00, Frédéric Galusik wrote: Hi, Can someone give me a clue on why nothing is printed to stdout ? I wish a list of files with their size. code: // import std.stdio; import std.file; void main(string[]

Re: [beginner] Why nothing is printed to stdout ?

2011-10-31 Thread Steven Schveighoffer
On Mon, 31 Oct 2011 06:01:05 -0400, Frédéric Galusik fr...@salixosnospam.org wrote: Le Mon, 31 Oct 2011 00:55:58 +0400, Dmitry Olshansky a écrit : On 30.10.2011 14:00, Frédéric Galusik wrote: Hi, Can someone give me a clue on why nothing is printed to stdout ? I wish a list of files with

Re: std.container ranges

2011-10-31 Thread Dmitry Olshansky
On 31.10.2011 18:38, Steven Schveighoffer wrote: On Mon, 31 Oct 2011 05:16:11 -0400, Dmitry Olshansky dmitry.o...@gmail.com wrote: On 31.10.2011 11:16, Tobias Pankrath wrote: Jonathan M Davis wrote: find allows you to do that just fine, and such a remove function would simply be duplicating

Re: std.container ranges

2011-10-31 Thread Dmitry Olshansky
Looks like it was accidental cross-posting: On 31.10.2011 20:11, Alessandro Stamatto wrote: it still would be horribly slow O(N^2). Personally, because of that I'd prefer hand-rolled intrusive singly-linked list any time of day. Now you're scaring me... You're saying that

Re: std.container ranges (n^2 ?!!!!)

2011-10-31 Thread Alessandro Stamatto
it still would be horribly slow O(N^2). Personally, because of that I'd prefer hand-rolled intrusive singly-linked list any time of day. Now you're scaring me... You're saying that SList in D not only is bugged, but a templated remove_if would run in O(N^2) instead of O(N)

Re: std.container ranges

2011-10-31 Thread Steven Schveighoffer
On Mon, 31 Oct 2011 12:40:37 -0400, Dmitry Olshansky dmitry.o...@gmail.com wrote: On 31.10.2011 18:38, Steven Schveighoffer wrote: On Mon, 31 Oct 2011 05:16:11 -0400, Dmitry Olshansky dmitry.o...@gmail.com wrote: On 31.10.2011 11:16, Tobias Pankrath wrote: Jonathan M Davis wrote: find

Re: Can't free memory on exiting?

2011-10-31 Thread bearophile
Andrej Mitrovic: Otherwise if you want to use the GC there's no point in calling GC.free in the destructor since the GC will do that automatically. And if the OP wants some determinism in the dellocation of the memory allocated with malloc, the OP has to use a struct (scope classes used to