22 template<
typename T,
typename Allocator>
28 template<
typename T,
typename Allocator>
43 if(firstToken != token::BEGIN_LIST)
46 <<
"expected token "<< token::BEGIN_LIST
47 <<
" but found "<< firstToken ;
60 && lastToken == token::END_LIST
78 <<
"expected token "<< token::BEGIN_LIST
79 <<
" but found "<< firstToken ;
88 template<
typename T,
typename Allocator>
97 auto stride = getVectorStride(len);
100 os << token::BEGIN_LIST;
105 os << this->operator[](i++);
106 for(
label j=0; j<stride-1 && i<len; j++ )
108 os << token::SPACE << this->operator[](i++);
115 os << token::END_LIST;
122 template<
typename T,
typename Allocator>
128 if( indices.
size() == 0 )
return true;
130 if( indices.
size() == 1 )
132 return deleteElement(indices[0]);
135 if( *(indices.end()-1) >= size() )
return false;
142 for(
auto& delem: indices)
144 for(
label i=lindex; i<delem; i++)
146 tmp.push_back( vectorType::operator[](i) );
152 for(
label i=lindex; i<size(); i++)
154 tmp.push_back( vectorType::operator[](i) );
158 vectorType::swap(tmp);
164 template<
typename T,
typename Allocator>
170 if( indices.
size() == 0 )
return true;
172 if( indices.
size() == 1)
174 return deleteElement(indices[0]);
178 auto sorted = indices;
180 return deleteElement_sorted(sorted);
183 template<
typename T,
typename Allocator>
191 auto iter = vectorType::begin();
192 advance(iter, index);
193 vectorType::erase(iter);
200 template<
typename T,
typename Allocator>
206 if(indices.
size() == 0)
return true;
213 auto idx = hIndices[i];
217 this->operator[](idx) = val;
221 this->push_back(val);
226 this->operator[](idx) = val;
232 template<
typename T,
typename Allocator>
237 if(indices.
size() == 0)
return true;
238 if(indices.
size() != vals.
size())
return false;
245 auto idx = hIndices[i];
248 this->operator[](idx) = vals[i];
252 this->push_back(vals[i]);
257 this->operator[](idx) = vals[i];
264 template<
typename T,
typename Allocator>
271 if(indices.
size() == 0)
return true;
276 auto idx = indices[i];
279 this->operator[](idx) = val;
283 this->push_back(val);
288 this->operator[](idx) = val;
295 template<
typename T,
typename Allocator>
302 if(indices.
size() == 0)
return true;
303 if(indices.
size() != vals.
size())
return false;
308 auto idx = indices[i];
311 this->operator[](idx) = vals[i];
315 this->push_back(vals[i]);
320 this->operator[](idx) = vals[i];
326 template<
typename T,
typename Allocator>
338 this->operator[](idx) = val;
342 this->push_back(val);
347 this->operator[](idx) = val;