[Issue 930] Templates inside templates used as mixins
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sun Feb 4 00:51:46 PST 2007
http://d.puremagic.com/issues/show_bug.cgi?id=930
wbaxter at gmail.com changed:
What |Removed |Added
----------------------------------------------------------------------------
Severity|normal |minor
------- Comment #1 from wbaxter at gmail.com 2007-02-04 02:51 -------
Addendum - At least for my purposes, it turns out this can be handled by using
templated static structs instead of mixins:
struct ATemplate(T) {
static:
T svar = 99;
void foo() {
T x = 2; // this line causes an error
printf("Hi\n");
}
}
class TheClass(MixIt)
{
MixIt mix;
}
void main() {
auto val = new TheClass!(ATemplate!(int));
val.mix.foo();
}
----
This isn't holding me up in any way now, so downgrading to minor.
--
More information about the Digitalmars-d-bugs
mailing list