struct f_launchsite_sort
{
bool operator()(const PLaunchSite ls1, const PLaunchSite ls2) const
{
// GetHeight() returns the height of the object and is comparable (like a float)
return ls1->GetHeight() > ls2->GetHeight();
}
};
typedef SnowSim::Model::ILaunchSite<PrecisionType>* PLaunchSite;
typedef std::set<PLaunchSite, f_launchsite_sort> LS_Set;
LS_Set* u1 = new LS_Set();
EdgeGroup::CDT_VIterator vit = eg->LaunchSites_Begin();
EdgeGroup::CDT_VIterator end = eg->LaunchSites_End();
/* go through all launch sites of this edge group */
/* and add them to the sorted list u1 */
while (vit != end) {
PLaunchSite ls = &(*vit);
pair<LS_Set::iterator, bool> result;
result = u1->insert(ls);
std::cout << ls << " -> returned iterator: " << *(result.first) << " inserted?: " << result.second << std::endl;
++vit;
}