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

--- Comment #0 from Austin Hastings <> 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

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

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:
------- You are receiving this mail because: -------

Reply via email to