Skip to content

Complete Section "Returned References"#33

Open
yonisimian wants to merge 1 commit intomainfrom
ysimian_returnedReferences
Open

Complete Section "Returned References"#33
yonisimian wants to merge 1 commit intomainfrom
ysimian_returnedReferences

Conversation

@yonisimian
Copy link
Copy Markdown
Owner

No description provided.

This was referenced Jan 9, 2026
@regevran
Copy link
Copy Markdown
Collaborator

@yonisimian - please refine the PR to be aligned with us selecting the syntax.

@yonisimian yonisimian force-pushed the ysimian_returnedReferences branch from 84774b3 to d97dcbb Compare March 15, 2026 12:12
Comment thread P3817.md

A notable use case for `std::tie` is assigning to the return value of a function that returns a reference:

```cpp
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is yet another difference between the suggested assignment to std::tie:
std::tie, being a function, does not guarantee order of evaluation of its parameters.
On the other hand, structure binding declaration guarantees the order, at least for tuple-like binding.
I think we should keep the sequence as guaranteed today for structure binding rather than trying to align with the function call guarantees (which are non).

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