Library Typedefs are fundamentally broken

monarch_dodra via Digitalmars-d digitalmars-d at puremagic.com
Wed Sep 17 00:30:09 PDT 2014


On Wednesday, 17 September 2014 at 07:21:13 UTC, Andrej Mitrovic 
via Digitalmars-d wrote:
> On 9/17/14, bearophile via Digitalmars-d 
> <digitalmars-d at puremagic.com> wrote:
>> Andrei Alexandrescu:
>>
>>> Add a sequence number as a uint, defaulted to 0. -- Andrei
>>
>> See discussion:
>> https://d.puremagic.com/issues/show_bug.cgi?id=12100
>
> It's a good thing you found GCC and VC implement this. I think 
> it's
> another sign that we could use this feature.

Technically, they implement it via macro, and the macro 
re-expands on every use. It's mostly useless outside of ".cpp" 
files: The identifiers are unstable cross compilation units. And 
if it appears in a .h, it'll be re-expanded to a different value 
on every include. If it appears in a macro, it'll be expanded to 
something different on every macro use too.


More information about the Digitalmars-d mailing list