From 287bdbd312d755dfa6d48264b3f01edee429c233 Mon Sep 17 00:00:00 2001 From: q66 Date: Thu, 23 Jul 2015 01:32:22 +0100 Subject: [PATCH] contiguous ranges provide the data() method to retrieve a pointer to the sequence --- ostd/range.hh | 3 +++ ostd/string.hh | 1 - 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/ostd/range.hh b/ostd/range.hh index 27441a5..b104e69 100644 --- a/ostd/range.hh +++ b/ostd/range.hh @@ -942,6 +942,9 @@ struct PointerRange: InputRange, ContiguousRangeTag, T> { return copy(PointerRange(p, c), c); } + T *data() { return p_beg; } + const T *data() const { return p_beg; } + private: T *p_beg, *p_end; }; diff --git a/ostd/string.hh b/ostd/string.hh index da44d37..0368a58 100644 --- a/ostd/string.hh +++ b/ostd/string.hh @@ -142,7 +142,6 @@ public: return true; } - /* non-range methods */ T *data() { return p_beg; } const T *data() const { return p_beg; }