Fix list::assign
This commit is contained in:
parent
eafe6f5a21
commit
9ad75d9f82
@ -323,19 +323,23 @@ namespace rexy{
|
||||
{
|
||||
auto current = begin();
|
||||
size_type i = 0;
|
||||
|
||||
if constexpr(std::is_assignable_v<value_type, decltype(*first)>){
|
||||
for(;i < m_size && first != last;++i){
|
||||
*current++ = *first++;
|
||||
}
|
||||
}
|
||||
if(first != last){
|
||||
m_size = i;
|
||||
while(first != last){
|
||||
current = ++(insert(current, *first++));
|
||||
}
|
||||
}else{
|
||||
if(first == last){
|
||||
erase(current, end());
|
||||
}
|
||||
m_size = i;
|
||||
}else{
|
||||
clear();
|
||||
current = end();
|
||||
}
|
||||
|
||||
while(first != last){
|
||||
current = ++(emplace(current, *first++));
|
||||
}
|
||||
}
|
||||
template<class T, class Alloc>
|
||||
REXY_CPP20_CONSTEXPR
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user