[Issue 6333] The 'capacity' function is not pure/nothrow/@safe.

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Jul 18 07:39:31 PDT 2011


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


Steven Schveighoffer <schveiguy at yahoo.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |schveiguy at yahoo.com


--- Comment #1 from Steven Schveighoffer <schveiguy at yahoo.com> 2011-07-18 07:34:13 PDT ---
I don't know if capacity can be pure.  I haven't thought about the implications
of making it pure, maybe there is a way.  It seems like a reasonable property.

However, it could technically be nothrow.  However, it's technically an alias
for arr.reserve(0), and reserve could definitely throw.

I'm unsure how to deal with that.  Maybe I need to separate the runtime
function into two, one that's pure nothrow, the other which might allocate
memory.

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