Library Typedefs are fundamentally broken
Vladimir Panteleev via Digitalmars-d
digitalmars-d at puremagic.com
Sat Sep 20 10:10:31 PDT 2014
On Saturday, 20 September 2014 at 17:05:40 UTC, Daniel Murphy
wrote:
> "Marco Leise" wrote in message
> news:20140920155851.030b1633 at marco-leise.homedns.org...
>
>> It has this nasty imperfection that it breaks as soon as you
>> define two Typedefs on the same line. Which noone ever does
>> except maybe for an obfuscated coding scenario, but still it
>> raises my OCD level.
>
> Or inside a template, but that breaks with an explicit cookie
> as well.
>
> template Foo(T)
> {
> alias FooIndex = Typedef!(int, "FooIndex");
> }
>
> static assert(!is(Foo!int == Foo!string));
What if you *want* a Typedef instantiation to be the same for all
instantiations of a parent template?
I think you can have both if Typedef simply takes an "ARGS...",
which defaults to TypeTuple!(__FILE__, __LINE__, __COLUMN__), but
in this case can be overridden to TypeTuple!(Foo, T).
More information about the Digitalmars-d
mailing list