diff --git a/octa/initializer_list.h b/octa/initializer_list.h index 83a8e10..023a067 100644 --- a/octa/initializer_list.h +++ b/octa/initializer_list.h @@ -19,19 +19,21 @@ namespace std { initializer_list(const T *v, size_t n): p_buf(v), p_len(n) {} public: - typedef size_t SizeType; - typedef ptrdiff_t DiffType; - typedef T ValType; - typedef T &RefType; - typedef const T &ConstRefType; - typedef T *PtrType; - typedef const T *ConstPtrType; + typedef size_t SizeType; + typedef ptrdiff_t DiffType; + typedef T ValType; + typedef const T &RefType; + typedef const T &ConstRefType; + typedef const T *PtrType; + typedef const T *ConstPtrType; + typedef octa::PointerRange RangeType; + typedef octa::PointerRange ConstRangeType; initializer_list(): p_buf(nullptr), p_len(0) {} size_t length() const { return p_len; } - const T *get() const { return p_buf; } + const T *data() const { return p_buf; } octa::PointerRange each() { return octa::PointerRange(p_buf, p_len); diff --git a/octa/vector.h b/octa/vector.h index 5874cd6..3341239 100644 --- a/octa/vector.h +++ b/octa/vector.h @@ -89,7 +89,7 @@ namespace octa { Vector(InitializerList v): Vector() { size_t len = v.length(); - const T *ptr = v.get(); + const T *ptr = v.data(); reserve(len); for (size_t i = 0; i < len; ++i) new (&p_buf[i]) T(ptr[i]); @@ -146,9 +146,9 @@ namespace octa { size_t ilen = il.length(); reserve(ilen); if (octa::IsPod()) { - memcpy(p_buf, il.get(), ilen); + memcpy(p_buf, il.data(), ilen); } else { - T *buf = p_buf, *ibuf = il.get(), *last = il.get() + ilen; + T *buf = p_buf, *ibuf = il.data(), *last = il.data() + ilen; while (ibuf != last) { new (buf++) T(*ibuf++); }