D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 5066 - Array back(set) method would crash when have none elements
Summary: Array back(set) method would crash when have none elements
Status: RESOLVED INVALID
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: Other All
: P2 normal
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-10-16 22:22 UTC by galaxylang
Modified: 2010-11-04 22:28 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description galaxylang 2010-10-16 22:22:32 UTC
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 galaxylang 2010-10-16 22:24:55 UTC
(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