Bug 24285 – Cannot swap a std.typecons.Tuple

Status
NEW
Severity
enhancement
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2023-12-18T11:42:39Z
Last change time
2024-12-01T16:42:05Z
Keywords
CTFE, pull
Assigned to
No Owner
Creator
Nick Treleaven
Moved to GitHub: phobos#10538 →

Comments

Comment #0 by nick — 2023-12-18T11:42:39Z
enum x = (){ import std.algorithm, std.typecons; Tuple!int a, b; swap(a, b); return 0; }(); /usr/include/dmd/phobos/std/algorithm/mutation.d(2836): Error: reinterpreting cast from `Tuple!int*` to `ubyte*` is not supported in CTFE First reported here: https://issues.dlang.org/show_bug.cgi?id=21429#c2 This also applies for any struct T that satisfies isBlitAssignable yet `hasElaborateAssign!T || !isAssignable!T` is true. PR incoming.
Comment #1 by dlang-bot — 2023-12-18T12:14:12Z
@ntrel created dlang/phobos pull request #8864 "Fix Issue 24285 - Cannot swap a std.typecons.Tuple" fixing this issue: - Fix Issue 24285 - Cannot swap a std.typecons.Tuple https://github.com/dlang/phobos/pull/8864
Comment #2 by robert.schadek — 2024-12-01T16:42:05Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/phobos/issues/10538 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB