Skip to content

Allow ADL for swapping Optional values#4569

Merged
aleks-f merged 1 commit intopocoproject:mainfrom
joukewitteveen:patch-1
Jun 17, 2024
Merged

Allow ADL for swapping Optional values#4569
aleks-f merged 1 commit intopocoproject:mainfrom
joukewitteveen:patch-1

Conversation

@joukewitteveen
Copy link
Copy Markdown
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants