[Issue 8398] New: enforceEx cannot be used with OutOfMemoryError

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Jul 18 02:50:52 PDT 2012


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

           Summary: enforceEx cannot be used with OutOfMemoryError
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nobody at puremagic.com
        ReportedBy: jakobovrum at gmail.com


--- Comment #0 from Jakob Ovrum <jakobovrum at gmail.com> 2012-07-18 02:50:51 PDT ---
This idiom would be quite useful to have:

    auto data = enforceEx!OutOfMemoryError(malloc(size));

However, OutOfMemoryError only provides this constructor:

   this(string file = __FILE__, size_t line = __LINE__, Throwable next = null )

I think enforceEx is at fault here, not OutOfMemoryError. The non-deprecated
overload of enforceEx should allow for constructors of the above form,
requiring the file and line but providing its own messsage.

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


More information about the Digitalmars-d-bugs mailing list