Bug 5066 – Array back(set) method would crash when have none elements
Status
RESOLVED
Resolution
INVALID
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
Other
OS
All
Creation time
2010-10-16T22:22:00Z
Last change time
2010-11-04T22:28:06Z
Assigned to
nobody
Creator
galaxylang
Comments
Comment #0 by galaxylang — 2010-10-16T22:22:32Z
import std.container;
int main(char[][])
{
array!int ar;
ar.back=1;
//the back(T){} method will enforce(!this.length.empty),so throw an exception
}
Comment #1 by galaxylang — 2010-10-16T22:24:55Z
(In reply to comment #0)
> import std.container;
> int main(char[][])
> {
> array!int ar;
>
> ar.back=1;
> //the back(T){} method will enforce(!this.empty),so throw an
> exception
> }
i make a mistake :this.length.empty-> this.empty