Skip to content

<xutility>: ranges::iter_swap is broken #1067

Description

@statementreply

Describe the bug

STL/stl/inc/xutility

Lines 1069 to 1071 in c10ae01

} else if constexpr (_Choice<_Ty1, _Ty2>._Strategy == _St::_Exchange) {
*static_cast<_Ty1&&>(_Val1) =
_Iter_exchange_move(static_cast<_Ty1&&>(_Val1), static_cast<_Ty2&&>(_Val2));

The behavior of this constexpr branch is incorrect.

STL version

https://github.com/microsoft/STL/commit/c10ae01b4d9508eed9d5f059a120ee7223b6ac12

Additional context

This bug causes test failure in #1062.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingfixedSomething works now, yay!

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions