<div class="gmail_quote">On 1 September 2012 19:08, Dmitry Olshansky <span dir="ltr"><<a href="mailto:dmitry.olsh@gmail.com" target="_blank">dmitry.olsh@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="HOEnZb"><div class="h5">On 01-Sep-12 19:58, Peter Alexander wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
C:<br>
<br>
int mul(int x, int y);<br>
<br>
<br>
Future D:<br>
<br>
pure @safe nothrow nogc commutative associative distributive<br>
@forceinline mayoverflow int mul(int x, int y);<br>
<br>
</blockquote>
<br></div></div>
No it's GNU C++ of today just replace 'pure' with __attribute__((pure))<br>
and you are done :)<br>
And don't even get me started at MS extensions...<br>
<br>
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.<br>
<br>
In fact if pure @safe nothrow could be combined in a user defined tag:<br>
<br>
alias pure @safe nothrow nogc nice_func;<br>
<br>
nice_func int mul(int x, int y);<br>
<br>
and even C has it via macros, damn...</blockquote><div><br></div><div>Aside the context of this thread, this would actually be REALLY useful. I think I've asked about it a few times before.</div><div>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.</div>
<div>I think the only current way is to duplicate the definitions in different version blocks.</div><div>An attribute alias would be super handy, particularly when abstracting support for multiple compilers.</div></div>