Thread overview
[Issue 11348] New: Introduce assumeWontThrow for use with nothrow functions
Oct 24, 2013
Andrej Mitrovic
Oct 24, 2013
Andrej Mitrovic
Oct 24, 2013
Andrej Mitrovic
October 24, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=11348

           Summary: Introduce assumeWontThrow for use with nothrow
                    functions
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: pull
          Severity: enhancement
          Priority: P2
         Component: Phobos
        AssignedTo: nobody@puremagic.com
        ReportedBy: andrej.mitrovich@gmail.com


--- Comment #0 from Andrej Mitrovic <andrej.mitrovich@gmail.com> 2013-10-24 14:35:54 PDT ---
The assumeWontThrow function is useful in contexts where a nothrow function might want to call some piece of code which is /not/ marked as nothrow even though it doesn't necessarily throw.

If the called function does throw, assumeWontThrow will promote the exception into an AssertError, which is an Error derivative and thus allows to be thrown from nothrow functions.

https://github.com/D-Programming-Language/phobos/pull/1571

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
October 24, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=11348



--- Comment #1 from Andrej Mitrovic <andrej.mitrovich@gmail.com> 2013-10-24 14:38:02 PDT ---
https://github.com/D-Programming-Language/phobos/commit/c97904bf4f041c7ad6666006cc9bfbdd339a1815

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
October 24, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=11348


Andrej Mitrovic <andrej.mitrovich@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


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