diff options
author | Shea Levy <shea@shealevy.com> | 2016-11-17 11:48:10 -0500 |
---|---|---|
committer | Shea Levy <shea@shealevy.com> | 2016-11-17 11:48:10 -0500 |
commit | 00b8bce4d0b1648961196d6d65a3a9898ff99e67 (patch) | |
tree | 9c7189d8a5ca20f9ea1c2d27e1f24e211630f4c4 /src/libutil | |
parent | 0d2ebb4373e509521f27a6e8f16bfd39d05b2188 (diff) |
Fix binary-cache-store build
Diffstat (limited to 'src/libutil')
-rw-r--r-- | src/libutil/util.hh | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/libutil/util.hh b/src/libutil/util.hh index f38c2bb7c..0a3315bb5 100644 --- a/src/libutil/util.hh +++ b/src/libutil/util.hh @@ -438,23 +438,24 @@ void callSuccess( class istringbuf_nocopy : public std::streambuf { const std::string & s; - std::streamsize off; + decltype(s.size()) off; + decltype(s.size()) size; public: - istringbuf_nocopy(const std::string & s) : s{s}, off{0} + istringbuf_nocopy(const std::string & s) : s{s}, off{0}, size{s.size()} { } private: int_type underflow() { - if (off == s.size()) + if (off == size) return traits_type::eof(); return traits_type::to_int_type(s[off]); } int_type uflow() { - if (off == s.size()) + if (off == size) return traits_type::eof(); return traits_type::to_int_type(s[off++]); } @@ -469,15 +470,15 @@ private: std::streamsize showmanyc() { - return s.size() - off; + return size - off; } }; -struct istringstream_nocopy : public std::istream +struct istringstream_nocopy : public std::iostream { istringbuf_nocopy buf; - istringstream_nocopy(const std::string & s) : std::istream(&buf), buf(s) {}; + istringstream_nocopy(const std::string & s) : std::iostream(&buf), buf(s) {}; }; |