[reSIProcate] Solaris libCstd breaks again
Scott's recent merge breaks things on Solaris again, in particular,
list::sort(Comparator) is not well supported (it is only used in two
places fortunately):
"monkeys/LocationServer.cxx", line 108: Error: Could not find a match
for std::list<repro::Target*>::sort(bool(const repro::Target*,const
repro::Target*)) needed in
repro::LocationServer::process(repro::RequestContext&).
"monkeys/RecursiveRedirect.cxx", line 50: Error: Could not find a match
for std::list<repro::Target*>::sort(bool(const repro::Target*,const
repro::Target*)) needed in
repro::RecursiveRedirect::process(repro::RequestContext&).
It is not just a const issue (I tried changing that already)
Trying to use std::sort() from <algorithm> is also not well supported:
std::sort(batch.begin(), batch.end(), Target::priorityMetricCompare);
"/opt/studio/sunstudio12.1/prod/include/CC/Cstd/./algorithm", line 795:
Error: The operation "std::list<repro::Target*>::iterator -
std::list<repro::Target*>::iterator" is illegal.
In fact, it seems necessary to change from using std::list to using
std::vector - but that has other knock-on effects.
If I make two changes, changing to a vector, and using std::sort
std::vector<Target*> batch;
sort(batch.begin(), batch.end(), Target::priorityMetricCompare);
then the sort works, but it fails later:
"monkeys/LocationServer.cxx", line 112: Error: Formal argument targets
of type std::list<repro::Target*>& in call to
repro::ResponseContext::addTargetBatch(std::list<repro::Target*>&, bool)
is being passed std::vector<repro::Target*>.
1 Error(s) detected.
Should we be using vector to solve issues like this? Or std::list needs
to be used, and a hack is needed for Solaris?