]>
git.saurik.com Git - apple/xnu.git/blob - tests/bounded_array_ref_src/operator.subscript.cpp
3 // T& operator[](ptrdiff_t n) const;
6 #include <libkern/c++/bounded_array_ref.h>
7 #include "test_policy.h"
8 #include <darwintest.h>
9 #include <darwintest_utils.h>
13 operator==(T
const& a
, T
const& b
)
23 T array
[5] = {T
{0}, T
{1}, T
{2}, T
{3}, T
{4}};
24 test_bounded_array_ref
<T
> view(array
);
25 CHECK(view
[0] == T
{0});
26 CHECK(view
[1] == T
{1});
27 CHECK(view
[2] == T
{2});
28 CHECK(view
[3] == T
{3});
29 CHECK(view
[4] == T
{4});
33 T_DECL(operator_subscript
, "bounded_array_ref.operator.subscript") {