Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow ADL for swapping Optional values #4569

Merged
merged 1 commit into from
Jun 17, 2024

Conversation

joukewitteveen
Copy link
Contributor

@joukewitteveen joukewitteveen commented May 28, 2024

Some types support being swapped but may not have declared their std::swap overloads when Poco/Optional.h is first included. This is the case for instance with

    #include <Poco/Optional.h>
    #include <array>

    using Problematic = Poco::Optional<std::array<int, 42> >;

With an unqualified call to swap, preceded by using std::swap, we allow argument-dependent lookup to find suitable implementations of swap.

Some types support being swapped but may not have declared their
std::swap overloads when Poco/Optional.h is first included. This is the
case for instance with

    #include <Poco/Optional.h>
    #include <array>

    using Problematic = Poco::Optional<std::array<int, 42> >;

With an unqualified call to swap, preceded by using std::swap, we allow
argument-dependent lookup to find suitable implementations of swap.
@aleks-f aleks-f added this to the Release 1.14.0 milestone Jun 2, 2024
@aleks-f aleks-f merged commit e00b4de into pocoproject:main Jun 17, 2024
32 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants