Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions include/iris/x4/core/move_to.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -209,13 +209,13 @@ move_to(It first, Se last, Dest& dest)
{
static_assert(!std::same_as<std::remove_const_t<Dest>, unused_type>);
static_assert(!std::same_as<std::remove_const_t<Dest>, unused_container_type>);
static_assert(
// If either `It` or `Dest` is relevant to any character type,
(!CharLike<std::remove_cvref_t<std::iter_value_t<It>>> && !CharLike<std::remove_cvref_t<typename traits::container_value<Dest>::type>>) ||
// ... then do the check below:
!CharIncompatibleWith<std::remove_cvref_t<std::iter_value_t<It>>, std::remove_cvref_t<typename traits::container_value<Dest>::type>>,
"Mixing incompatible char types is not allowed"
);

if constexpr (CharLike<std::remove_cvref_t<std::iter_value_t<It>>> && CharLike<std::remove_cvref_t<typename traits::container_value<Dest>::type>>) {
static_assert(
std::same_as<std::remove_cvref_t<std::iter_value_t<It>>, std::remove_cvref_t<typename traits::container_value<Dest>::type>>,
"Mixing incompatible char types is not allowed"
);
}

if constexpr (!is_ttp_specialization_of_v<Dest, container_appender>) {
if (!traits::is_empty(dest)) {
Expand Down Expand Up @@ -265,7 +265,7 @@ move_to(Source&& src, Dest& dest)
{
static_assert(!std::same_as<std::remove_cvref_t<Source>, Dest>, "[BUG] This call should instead resolve to the overload handling identical types");

if constexpr (std::same_as<std::remove_cvref_t<Source>, typename traits::container_value<Dest>::type>) {
if constexpr (std::constructible_from<typename traits::container_value<Dest>::type, Source>) {
traits::push_back(dest, std::forward<Source>(src));
} else {
if constexpr (std::is_rvalue_reference_v<Source&&>) {
Expand Down
Loading