diff --git a/octa/range.hh b/octa/range.hh index 8a30d8e..b28e03b 100644 --- a/octa/range.hh +++ b/octa/range.hh @@ -463,8 +463,8 @@ template::value - >> Size get_n(OR orange, Size n = -1) { - B &r = *((B *)this); + >> Size copy(OR orange, Size n = -1) { + B r(*((B *)this)); Size on = n; for (; n && !r.empty(); --n) { orange.put(r.front()); @@ -473,8 +473,8 @@ template *p, Size n = -1) { - B &r = *((B *)this); + Size copy(octa::RemoveCv *p, Size n = -1) { + B r(*((B *)this)); Size on = n; for (; n && !r.empty(); --n) { *p++ = r.front(); @@ -910,16 +910,16 @@ struct PointerRange: InputRange, FiniteRandomAccessRangeTag, T> template::value - >> octa::Size get_n(R orange, octa::Size n = -1) { + >> octa::Size copy(R orange, octa::Size n = -1) { octa::Size c = size(); if (n < c) c = n; return orange.put_n(p_beg, c); } - octa::Size get_n(octa::RemoveCv *p, octa::Size n = -1) { + octa::Size copy(octa::RemoveCv *p, octa::Size n = -1) { octa::Size c = size(); if (n < c) c = n; - return get_n(PointerRange(p, c), c); + return copy(PointerRange(p, c), c); } private: diff --git a/octa/stream.hh b/octa/stream.hh index 945ed58..d35897c 100644 --- a/octa/stream.hh +++ b/octa/stream.hh @@ -214,7 +214,7 @@ struct StreamRange: InputRange< return p_stream->put(p, n); } - octa::Size get_n(octa::RemoveCv *p, octa::Size n = -1) { + octa::Size copy(octa::RemoveCv *p, octa::Size n = -1) { if (n == octa::Size(-1)) { n = p_stream->size() / sizeof(T); } diff --git a/octa/vector.hh b/octa/vector.hh index 327a616..c82b4f0 100644 --- a/octa/vector.hh +++ b/octa/vector.hh @@ -45,7 +45,7 @@ class Vector { octa::RangeSize l = range.size(); reserve(l); p_len = l; - range.get_n(p_buf.first(), l); + range.copy(p_buf.first(), l); } template