Commit 6c4f943e authored by JINMEI Tatuya's avatar JINMEI Tatuya
Browse files

[2764] implement postfix version of EncodeNormalizer::operator++.

transform_width in Boost 1.53 requires this version, so build will fail
without it.
parent 4246e4ed
......@@ -110,15 +110,15 @@ public:
const vector<uint8_t>::const_iterator& base_end) :
base_(base), base_end_(base_end), in_pad_(false)
{}
EncodeNormalizer& operator++() {
if (!in_pad_) {
++base_;
}
if (base_ == base_end_) {
in_pad_ = true;
}
EncodeNormalizer& operator++() { // prefix version
increment();
return (*this);
}
EncodeNormalizer operator++(int) { // postfix version
const EncodeNormalizer copy = *this;
increment();
return (copy);
}
const uint8_t& operator*() const {
if (in_pad_) {
return (BINARY_ZERO_CODE);
......@@ -130,6 +130,14 @@ public:
return (base_ == other.base_);
}
private:
void increment() {
if (!in_pad_) {
++base_;
}
if (base_ == base_end_) {
in_pad_ = true;
}
}
vector<uint8_t>::const_iterator base_;
const vector<uint8_t>::const_iterator base_end_;
bool in_pad_;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment