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: nob...@puremagic.com
        ReportedBy: jakobov...@gmail.com


--- Comment #0 from Jakob Ovrum <jakobov...@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: -------

Reply via email to