From 54789177e2575acb7007e339bb21d1162a3e63ee Mon Sep 17 00:00:00 2001 From: q66 Date: Thu, 24 Mar 2016 21:52:16 +0000 Subject: [PATCH] no need for a typedef --- ostd/string.hh | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/ostd/string.hh b/ostd/string.hh index 21be612..7f53bbf 100644 --- a/ostd/string.hh +++ b/ostd/string.hh @@ -871,8 +871,7 @@ String to_string(std::initializer_list init) { template struct TempCString { private: - using Value = RemoveCv>; - Value *p_buf; + RemoveCv> *p_buf; bool p_allocated; public: @@ -882,11 +881,11 @@ public: s.p_buf = nullptr; s.p_allocated = false; } - TempCString(R input, Value *sbuf, Size bufsize) + TempCString(R input, RemoveCv> *sbuf, Size bufsize) : p_buf(nullptr), p_allocated(false) { if (input.empty()) return; if (input.size() >= bufsize) { - p_buf = new Value[input.size() + 1]; + p_buf = new RemoveCv>[input.size() + 1]; p_allocated = true; } else p_buf = sbuf; p_buf[input.copy(p_buf)] = '\0'; @@ -901,8 +900,8 @@ public: return *this; } - operator const Value *() const { return p_buf; } - const Value *get() const { return p_buf; } + operator const RemoveCv> *() const { return p_buf; } + const RemoveCv> *get() const { return p_buf; } void swap(TempCString &s) { detail::swap_adl(p_buf, s.p_buf);