DIP18: Non-GC threads

Manu turkeyman at gmail.com
Mon Sep 3 02:38:33 PDT 2012


On 1 September 2012 19:08, Dmitry Olshansky <dmitry.olsh at gmail.com> wrote:

> On 01-Sep-12 19:58, Peter Alexander wrote:
>
>> C:
>>
>> int mul(int x, int y);
>>
>>
>> Future D:
>>
>> pure @safe nothrow nogc commutative associative distributive
>> @forceinline mayoverflow int mul(int x, int y);
>>
>>
> No it's GNU C++ of today just replace 'pure' with __attribute__((pure))
> and you are done :)
> And don't even get me started at MS extensions...
>
> Either way this is a kind of thing that only some users need but std
> library have to use all of them just so that those 'some users' can use it.
>
> In fact if pure @safe nothrow could be combined in a user defined tag:
>
> alias pure @safe nothrow nogc nice_func;
>
> nice_func int mul(int x, int y);
>
> and even C has it via macros, damn...


Aside the context of this thread, this would actually be REALLY useful. I
think I've asked about it a few times before.
There is already a fairly annoying problem where GDC supports GNU
attributes that DMD doesn't know about, which are basically impossible to
use; there's no nice way to use compiler-specific attributes without some
sort of alias like this.
I think the only current way is to duplicate the definitions in different
version blocks.
An attribute alias would be super handy, particularly when abstracting
support for multiple compilers.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20120903/3f91f5e8/attachment.html>


More information about the Digitalmars-d mailing list