I need to sort a collection of Element
. Is there any specific advantage of sorting a vector of Element*
i.e
std::vector<Element*> vectRef;
to sorting a vector of Element
.
std::vector<Element> vect;
assuming I write the comparator accordingly.
Element
struct is show below:
struct Element
{
Record *elm;
Element(Record *rec)
{
elm = new Record();
//...copy from rec
}
~Element()
{
delete elm;
}
};