http://d.puremagic.com/issues/show_bug.cgi?id=4991

           Summary: Make 'nothrow', other function attributes, accessible
                    (via traits?)
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: DMD
        AssignedTo: nob...@puremagic.com
        ReportedBy: ah0801...@yahoo.com


--- Comment #0 from Austin Hastings <ah0801...@yahoo.com> 2010-10-04 12:15:45 
PDT ---
In a template, I'd like to declare a mathematical function as pure/nothrow. The
problem is that I am using a traits template to specify behavior for some edge
conditions, and the caller may reasonably want the edge case to throw an
exception.

So I would like to be able to statically detect the nothrow status of the trait
class' behavior handler, and reflect that in the declaration of the template
function.

At the very least, this means providing a boolean query for nothrow. But in
fact, propagating the attribute would benefit from additional capabilities.

Declaring a function "conditionally nothrow" presently seems to require a
conditional re-declaration of the entire function either with or without the
nothrow added. There seems to be no way to mixin("nothrow") or { alias nothrow
NT } to add in the attribute.

Perhaps this kind of "attribute propagation" needs some kind of special tuple?
Or is this a reason to support prototypes?

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------

Reply via email to