Skip to content

Conversation

@eisenwave
Copy link
Member

@eisenwave eisenwave commented Oct 20, 2024

Partially addresses #7261.

This PR replaces the informal "avoid the use of dynamically allocated memory" terminology with the more formal "should nest an object within" terminology, which similar to "is nested within", seen in LWG4141.

This does not yet fix all such issues pointed out in #7261 for the sake of keeping this PR minimal.

… [any.class.general] Reword avoidance of 'dynamically allocated memory' as 'nesting an object within'
@eisenwave eisenwave added the P2-Bug Presentational errors and omissions label Nov 6, 2025

\pnum
Implementations should avoid the use of dynamically allocated memory for a small contained value.
Implementations should nest an object within\iref{intro.object}
Copy link
Contributor

Choose a reason for hiding this comment

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

The first "an object" seems both vague and unhelpful. Surely there is already some object nested within the any -- but the point is that there's a very specific object (namely the one that the user wants to store) should be nested within the any. The original wording was clearer about that since it at least said "contained value".

Copy link
Member Author

@eisenwave eisenwave Nov 7, 2025

Choose a reason for hiding this comment

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

I'm a bit confused about your comment. This is just applying the wording idiom that LWG came up with and replacing a term that is entirely undefined within the standard. That seems like a clear improvement (arguably an objective bug fix).

The part

for a small contained value

... remains unchanged, so why are you pointing out that its existence makes only the old wording clearer? Did you misread and come to the conclusion that that part is being deleted?

Copy link
Member Author

Choose a reason for hiding this comment

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

Looking at LWG4141, LWG seems comfortable with the "nested within" idiom.

@jwakely do you have an opinion on this PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P2-Bug Presentational errors and omissions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants