"operator <" would probably be more appropriate here, it will make vector<GasNode> sortable with std::sort() without having to specify Compare as the extra parameter.