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