Re: Return type of std.algorithm.map

2011-07-08 Thread James Fisher
function templating and the other uses return type inference. Any answers? On Thu, Jul 7, 2011 at 7:31 PM, Steven Schveighoffer schvei...@yahoo.comwrote: On Thu, 07 Jul 2011 10:00:48 -0400, James Fisher jameshfis...@gmail.com wrote: To date, I've been using D in much the same way I used C

Re: Return type of std.algorithm.map

2011-07-08 Thread James Fisher
On Fri, Jul 8, 2011 at 4:06 PM, James Fisher jameshfis...@gmail.com wrote: So ... stuff works, but I'm not really sure why one uses function templating and the other uses return type inference. Any answers? ... Wait, brain malfunction; I think I do understand. The type is inferable purely

Re: Return type of std.algorithm.map

2011-07-08 Thread James Fisher
On Fri, Jul 8, 2011 at 4:49 PM, Steven Schveighoffer schvei...@yahoo.comwrote: On Fri, 08 Jul 2011 11:08:14 -0400, James Fisher jameshfis...@gmail.com wrote: On Fri, Jul 8, 2011 at 4:06 PM, James Fisher jameshfis...@gmail.com wrote: So ... stuff works, but I'm not really sure why one

Return type of std.algorithm.map

2011-07-07 Thread James Fisher
To date, I've been using D in much the same way I used C++, without heavy use of templates. Now I'm trying out a more functional style using std.algorithm. However I'm pretty much stuck at the first hurdle: map. With type inference, this works: import std.algorithm; import std.stdio; void