+ struct SortLessThanPosition {
+ bool operator() (const KeyType& lhs, const KeyType& rhs) {
+
+ // force unmapped alignments to end
+ if ( lhs.first == -1 ) return false;
+ if ( rhs.first == -1 ) return true;
+
+ // sort first on RefID, then by Position
+ if ( lhs.first != rhs.first )
+ return lhs.first < rhs.first;
+ else
+ return lhs.second < rhs.second;
+ }
+ };
+
+ typedef SortLessThanPosition Compare;
+
+ typedef std::multimap<KeyType, ValueType, Compare> ContainerType;