[Issue 4977] New: cannot use nothrow or pure with Rebindable

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Oct 2 17:40:05 PDT 2010


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

           Summary: cannot use nothrow or pure with Rebindable
           Product: D
           Version: unspecified
          Platform: Other
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nobody at puremagic.com
        ReportedBy: jmdavisProg at gmx.com


--- Comment #0 from Jonathan M Davis <jmdavisProg at gmx.com> 2010-10-02 17:39:46 PDT ---
Rebindable does nothing about nothrow or pure. None of its functions are marked
on nothrow or pure, making it rather difficult to use Rebindable with a type
which has carefully been made to correctly use nothrow and/or pure.

The first thing would be to make opDot() nothrow and pure. I'm pretty sure that
you can get away with that (though pure may not be possible until the next
version of the compiler is released with the changes to pure that Don
suggested).

opAssign() would probably be just as easy, though I'm not sure. Since we're
dealing with copying classes, interfaces, or arrays, I think that you can just
make opAssign nothrow with no problem (since you have no postblit constructor
to worry about possibly throwing). On purity, I'm not so sure. It might work
now, or it might require the changes Don suggested, but I think that it will
work at that point.

Since the constructor uses opAssign(), it will probably be just as
easy/difficult to change as opAssign will be.

In any case, as it stands, its rather difficult to use either nothrow or pure
with Rebindable, which either severely limits where you can use Rebindable, or
it severely limits the type that you put in Rebindable.

rebindable() will likely have to be changed appropriately as well.

-- 
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