alias and template instantiations (Re: Any word on the return-type const syntax? [OT])
Bill Baxter
dnewsgroup at billbaxter.com
Sun Dec 9 13:52:50 PST 2007
Janice Caron wrote:
> On 12/9/07, Bill Baxter <dnewsgroup at billbaxter.com> wrote:
>> The instatiate-if-aliased behavior of D is a little annoying because it
>> means you can't create convenience aliases of your templates without
>> bloating up your executable. For linear algebra types, for instance,
>> many C++ libraries will provide typedefs for the most common
>> combinations of floating point type and number of components, maybe a
>> dozen or so of these.
>
> This begs the question, will
<voice=Inigo Montoya> You keep using that phrase. I do not think it
means what you think it means.</voice>
> enum SomeTemplate!(int) x;
>
> instantiate the template if x is not used?
There's definitely something needing explaining here. On the one hand
new enum is supposed to be just like old enum expanded (no storage just
a #define basically), and on the other its supposed to be like D2's
current const storage class.
--bb
More information about the Digitalmars-d
mailing list