D-Programming-Language/phobos — pull request #1566 by tom-tan (2013-09-11 14:00:59+00:00)
Title: Fix the range primitives for array in std.array

This pull request includes the following changes for the range primitives for built-in arrays (`empty`, `save`, `front`, `back`, `popFront` and `popBack`).

* mark them as safe, pure and nothrow
Some primitives for built-in string types cannot be nothrow because the functions in `std.utf` may throw.

* mark the unittest for them as safe, pure and nothrow

* Use documented unittests instead of the examples in the comments and normal unittests
In the documented unittest for `back`, I use the following unittest which has two additional lines from the original example in the comment.
It is because I reuse one of the original unittests for the documented unittest.

```d
int[] a = [ 1, 2, 3 ];
assert(a.back == 3);
a.back += 4;
assert(a.back == 7);
```