Skip to content

Fix compilation of libfabric backend with Boost 1.87.0 and newer#51

Merged
boeschf merged 1 commit intoghex-org:mainfrom
msimberg:endpoints-consume-boost-lockfree
Jan 31, 2025
Merged

Fix compilation of libfabric backend with Boost 1.87.0 and newer#51
boeschf merged 1 commit intoghex-org:mainfrom
msimberg:endpoints-consume-boost-lockfree

Conversation

@msimberg
Copy link
Contributor

Boost 1.87.0 changed the consume_one function (used by consume_all) to actually move arguments into the callback (boostorg/lockfree@5e9bc81, specifically this line: https://github.com/boostorg/lockfree/blob/5e9bc81d9c1763861a03811266edb142b797987d/include/boost/lockfree/queue.hpp#L537). This breaks compilation of the libfabric backend in oomph because the callback expects to receive the endpoint_wrapper by l-value reference.

This fixes compilation by using a universal reference auto&&. This allows taking the endpoint wrapper by reference in all cases. Using endpoint_wrapper&& would fix compilation with Boost 1.87.0, but break it with older versions. Taking it by value would also work with all versions, but introduces an extra move/copy construction. I do like explicitly naming types if possible, but in this case it seems worth the tradeoff to use auto.

Copy link
Collaborator

@biddisco biddisco left a comment

Choose a reason for hiding this comment

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

LGTM

@boeschf boeschf merged commit 13f277d into ghex-org:main Jan 31, 2025
4 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.

3 participants