[Issue 11240] assumeSafeAppend could implicitly break immutablity

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Oct 13 00:45:35 PDT 2013


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


monarchdodra at gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |monarchdodra at gmail.com


--- Comment #1 from monarchdodra at gmail.com 2013-10-13 00:45:34 PDT ---
Is this valid though?

assumeSafeAppend is an unsafe function that *requires* no one else have a view
on the items after the end of the array.

Just the same, you will overwrite the old items, without destroying them, nor
assigning over them.

I think this is just an unsafe function that was used wrong. The result is
simply undefined behavior.

I think it would be a needless restriction to not allow assumeSafeAppend on
immutable (and const).

This seems invalid to me.

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