Max Samukha wrote:
On Fri, 23 Oct 2009 13:08:06 -0500, Andrei Alexandrescu
<seewebsiteforem...@erdani.org> wrote:
I wanted to use auto, but ddoc cannot document functions with auto returns.
Andrei
When I need to hack around an 'auto' bug, I sometimes factor out the
return type to a template:
template IotaRet(B, E, S = size_t)
{
alias Take!(Sequence!("a.field[0] + n * a.field[1]",
Tuple!(CommonType!(B, E), S))) IotaRet;
}
IotaRet!(B, E, S) iota(B, E, S)(B begin, E end, S step) {}
IotaRet!(B, E) iota(B, E)(B begin, E end) {}
I think I'll do that.
P.S. It looks like TDPL will scream today through the 100,000 words
barrier (at 97,781 words now, see and track at www.erdani.com). When
that happens, I'll celebrate by making another excerpt available online.
Congrats!
Well not just yet. I had to remove a wad of text that was dedicated to
T[new], so after a full day's work I'm only at 97,917 words.
Andrei