Re: how can I ensure that a template instantiation is unique?

2014-06-19 Thread Andrew Edwards via Digitalmars-d-learn
On 6/19/14, 1:48 AM, Vlad Levenfeld wrote: I'm instantiating a couple of template structs that conflict with each other. I'd like them to be unique types, automatically. So I tried this: template Foo (string unique_id = __FILE__~__LINE__.to!string) {...} but it didn't work. When I use this for

Re: how can I ensure that a template instantiation is unique?

2014-06-19 Thread Andrea Fontana via Digitalmars-d-learn
On Thursday, 19 June 2014 at 05:48:24 UTC, Vlad Levenfeld wrote: I'm instantiating a couple of template structs that conflict with each other. I'd like them to be unique types, automatically. So I tried this: template Foo (string unique_id = __FILE__~__LINE__.to!string) {...} but it didn't

Re: how can I ensure that a template instantiation is unique?

2014-06-19 Thread Andrea Fontana via Digitalmars-d-learn
On Thursday, 19 June 2014 at 07:26:12 UTC, Andrea Fontana wrote: On Thursday, 19 June 2014 at 05:48:24 UTC, Vlad Levenfeld wrote: I'm instantiating a couple of template structs that conflict with each other. I'd like them to be unique types, automatically. So I tried this: template Foo

Re: how can I ensure that a template instantiation is unique?

2014-06-19 Thread Vlad Levenfeld via Digitalmars-d-learn
Thanks! Mixin strings can punch through anything.

how can I ensure that a template instantiation is unique?

2014-06-18 Thread Vlad Levenfeld via Digitalmars-d-learn
I'm instantiating a couple of template structs that conflict with each other. I'd like them to be unique types, automatically. So I tried this: template Foo (string unique_id = __FILE__~__LINE__.to!string) {...} but it didn't work. When I use this for templated functions, I get the file and