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