nothrow function callbacks in extern(C) code - solution

H. S. Teoh via Digitalmars-d digitalmars-d at puremagic.com
Thu Jun 19 15:35:07 PDT 2014


On Thu, Jun 19, 2014 at 10:22:32PM +0000, w0rp via Digitalmars-d wrote:
> On Thursday, 19 June 2014 at 20:29:42 UTC, Dicebot wrote:
> >+1
> >I have always wondered why `inout` is limited to const when problem
> >is almost identical with all other restrictive attributes.
> 
> I think the most common function this kind of thing could be useful
> for would be opApply functions. I haven't yet figured out a good way
> to make opApply implementations get all of the nice qualifiers without
> writing a bunch of overloads. Of course, in my own code I often just
> enforce the qualifiers to the exclusion of code without them, but
> that's no good for a standard library.

Yes I mention opApply in my post. ;-)

This isn't the only issue with opApply, though. The other issue is that
you can't (easily) control the ref-ness of the loop index.

And another the (lack of) inlining of loop bodies when opApply is
involved. This makes them slightly less attractive in
performance-sensitive situations, which is unfortunate.


T

-- 
It is impossible to make anything foolproof because fools are so ingenious. -- Sammy


More information about the Digitalmars-d mailing list