Home » U++ Library support » U++ Core » Implementation of Vector::Add()
Implementation of Vector::Add() [message #52203] |
Fri, 09 August 2019 04:26 |
Novo
Messages: 1358 Registered: December 2006
|
Ultimate Contributor |
|
|
Vector::Add() (and similar methods) can be implemented via Vector::Add(T&& x=T()). That reduces amount of code.
Similar methods include:
Array::Add()
BiVector::AddHead(), BiVector::AddTail()
AMap::Add(K&& k), Add(const K& k), FindAdd(const K& k), FindAdd(K&& k), Put(const K& k), e.t.c.
ArrayMap::Add(const K& k), Add(K&& k)
FixedAMap::Add(const K& k)
It looks like half of methods of AMap can be eliminated ...
Just my two cents ...
Regards,
Novo
|
|
|
|
Re: Implementation of Vector::Add() [message #52216 is a reply to message #52204] |
Fri, 09 August 2019 19:06 |
Novo
Messages: 1358 Registered: December 2006
|
Ultimate Contributor |
|
|
mirek wrote on Fri, 09 August 2019 02:50That AFAIK requires that T has defined move constructor. Add() only requires default constructor.
Mirek
You are right. I missed this point.
Regards,
Novo
|
|
|
Goto Forum:
Current Time: Fri Apr 26 00:29:47 CEST 2024
Total time taken to generate the page: 0.06216 seconds
|