Skip to content

Use boost::addressof to get address of user types - #113

Merged
spreadsort merged 1 commit into
boostorg:developfrom
cdglove:develop
Nov 2, 2026
Merged

spreadsort merged 1 commit into
boostorg:developfrom
cdglove:develop

Conversation

@cdglove

@cdglove cdglove commented Oct 30, 2026

Copy link
Copy Markdown
Contributor

User supplied types that override operator& will either fail to compile, or worse may compile if the pointer is compatible with what the code expects, but then almost certainly due to broken expectations.

Using boost::address of circumvents the use of operator& in user supplied types to get to the actual address of the object.

@spreadsort

Copy link
Copy Markdown
Collaborator

This is a good idea for odd cases, but it's failing some tests; it looks like some builds can't find the new test file.

User supplied types that override operator& will either fail to compile,
or worse may compile if the pointer is compatible with what the code
expects, but then almost certainly due to broken expectations.

Using boost::address of circumvents the use of operator& in user
supplied types to get to the actual address of the object.
@cdglove

cdglove commented Nov 1, 2026

Copy link
Copy Markdown
Contributor Author

Somehow didn't to add the new file to the commit. I've amended and pushed again.

@spreadsort
spreadsort merged commit 8b8d088 into boostorg:develop Nov 2, 2026
11 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