chaining chain Result and underlying object of chain

Ali Çehreli via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Mon Sep 14 08:30:14 PDT 2015


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



More information about the Digitalmars-d-learn mailing list