How to pass voldemort types to functions

2015-06-12 Thread kerdemdemir via Digitalmars-d-learn
Hi; I have tuples created by std.algorithm.group function. auto tupleB = stringB.group(); I need to write a a function which takes tubleB and do some cool stuff. If I don't use a function and write all code below .group() everytihng works but for reusing the code I want to call a

Re: How to pass voldemort types to functions

2015-06-12 Thread Ali Çehreli via Digitalmars-d-learn
On 06/12/2015 03:19 PM, kerdemdemir wrote: Hi; I have tuples created by std.algorithm.group function. auto tupleB = stringB.group(); I need to write a a function which takes tubleB and do some cool stuff. If I don't use a function and write all code below .group() everytihng works

Re: How to pass voldemort types to functions

2015-06-12 Thread kerdemdemir via Digitalmars-d-learn
void foo(R)(R range) if (isInstanceOf!(Tuple, ElementType!R))// -- optional { Ali thanks a lot. I don't believe I didn't simply try your way. It works. I am also happy to learn optional static if . Your examples are really useful for me. Next time I will share whole code. Thanks

Re: How to pass voldemort types to functions

2015-06-12 Thread Ali Çehreli via Digitalmars-d-learn
On 06/12/2015 03:46 PM, kerdemdemir wrote: void foo(R)(R range) if (isInstanceOf!(Tuple, ElementType!R))// -- optional { I am also happy to learn optional static if . Actually, it is not 'static if' but a template constraint. It is optional because everything will work without it.