Fix copy construction of some classes - #362
Merged
gennaroprota merged 2 commits intoJul 31, 2026
Merged
Conversation
`xml_escape` and `xml_unescape` had a hand-written copy constructor, added long ago as an Intel 7.1 workaround, that reconstructed the `escape<>` / `unescape<>` base from `rhs.base_reference()` alone. That runs the base's one-argument constructor and resets its in-progress state (`m_full`, `m_bnext`, `m_bend`, `m_current_value`), so a copy taken in the middle of an escape sequence forgot where it was and restarted the sequence. This removes the hand-written copy constructors and use the compiler-generated ones, which copy the full base state. Intel 7.1 (from 2003) is long gone from the supported toolchains. `xml_unescape` had the identical defect on the read side and is fixed the same way. Closes #229.
Same defect class as the `xml_escape` / `xml_unescape` fix in the previous commit: a hand-written copy constructor, written for Intel 7.1, that silently dropped part of the iterator's state. The bug is not reachable through the archive save/load paths, which drive the base64 pipeline with a single iterator instance, but these iterators are public and meant to be composed, and `std::copy` and buffered adaptors (as in issue #229) copy an iterator in mid stream. Remove both hand-written copy constructors and use the compiler- generated ones, which copy the full state. Refs #229.
gennaroprota
force-pushed
the
fix/xml-escape-preserves-state-across-copy
branch
from
July 30, 2026 14:49
57b3a62 to
be367b7
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This removes a few erroneous copy constructors which were introduced as workarounds for the now outdated Intel 7.1.
Closes #229.