-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Some classes use X4Movable to show human-friendly errors but in return the current implementation of X4Movable is not SFINAE-friendly in certain scenario.
Generically speaking, any concept should be SFINAE-friendly. We should fix X4Movable while keeping human-friendly errors in all usages.
The overload below should ideally be = delete("with reason"); but it's not implemented in C++23. How can we solve this issue?
x4/include/iris/x4/core/move_to.hpp
Lines 68 to 84 in e811b03
| template<traits::NonUnusedAttr T> | |
| constexpr void move_to(T&, T&) noexcept | |
| { | |
| static_assert( | |
| !std::is_const_v<T>, | |
| "`x4::move_to(T const&, T const&)` is not allowed" | |
| ); | |
| static_assert( | |
| false, | |
| "lvalue reference detected on the `src` argument of `x4::move_to`. " | |
| "The caller is definitely lacking `std::move` or `std::forward`. If you " | |
| "intend to *copy* the mutable value, apply `x4::move_to(std::as_const(attr_), attr)`." | |
| ); | |
| // Banned: possible, but bug-prone. | |
| // dest = std::move(src); | |
| } |
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working