Skip to content

Fix pairs that save references to constructed values - #639

Merged
nunoplopes merged 5 commits into
Cpp2Rust:masterfrom
lucic71:55-mapped-reference-fields
Nov 18, 2026
Merged

nunoplopes merged 5 commits into
Cpp2Rust:masterfrom
lucic71:55-mapped-reference-fields

Conversation

@lucic71

@lucic71 lucic71 commented Nov 17, 2026

Copy link
Copy Markdown
Contributor
  int referent = 5;
  std::pair<const int &, char> bound(referent, 'c');
  referent = 6;
  assert(bound.first == 6);

In the general case this fixes any STL class that saves references into the constructed values.

@nunoplopes

Copy link
Copy Markdown
Contributor

(conflict)

@nunoplopes
nunoplopes merged commit c1ba4f0 into Cpp2Rust:master Nov 18, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants