chaining chain Result and underlying object of chain

John Colvin via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Mon Sep 14 08:34:25 PDT 2015


On Monday, 14 September 2015 at 15:30:14 UTC, Ali Çehreli wrote:
> On 09/14/2015 08:01 AM, Laeeth Isharc wrote:
> > I was trying to use the same variable eg
> >
> >        auto chain1 = chain("foo", "bar");
> >        chain1 = chain(chain1, "baz");
> [...]
> > It may be that the type of chain1
> > and chain2 don't mix.
>
> Exactly.
>
> I was going to recommend using pragma(msg, typeof(chain1)) to 
> see what they are but it looks like chain()'s return type is 
> not templatized. (?)
>
>     pragma(msg, typeof(chain1));
>     pragma(msg, typeof(chain2));
>
> Prints
>
> Result
> Result
>
> instead of something like (hypothetical)
>
> ChainResult!(string, string)
> ChainResult!(ChainResult!(string, string), string)
>
> Ali

It is templated, but by means of it's enclosing function being 
templated, which doesn't end up in the name.


More information about the Digitalmars-d-learn mailing list