diff --git a/m-array.h b/m-array.h index 5f3d6a82..80e235cf 100644 --- a/m-array.h +++ b/m-array.h @@ -545,6 +545,22 @@ return M_CONST_CAST(type, &v->ptr[i]); \ } \ \ + static inline const type * \ + M_C(name, _front)(const array_t v) \ + { \ + ARRAYI_CONTRACT(v); \ + assert (v->size > 0); \ + return M_C(name, _cget)(v, 0); \ + } \ + \ + static inline const type * \ + M_C(name, _last)(const array_t v) \ + { \ + ARRAYI_CONTRACT(v); \ + assert (v->size > 0); \ + return M_C(name, _cget)(v, v->size-1); \ + } \ + \ static inline void \ M_C(name, _it)(array_it_t it, const array_t v) \ { \