rem: if (a.family != b.family) return a.family < b.family; switch (a.family) { case B_BEOS_FORMAT_FAMILY: return a.u.beos.format < b.u.beos.format; case B_QUICKTIME_FORMAT_FAMILY: return a.u.quicktime.codec < b.u.quicktime.codec || a.u.quicktime.vendor < b.u.quicktime.vendor; case B_AVI_FORMAT_FAMILY: return a.u.avi.codec < b.u.avi.codec; case B_ASF_FORMAT_FAMILY: return a.u.asf.guid < b.u.asf.guid; case B_MPEG_FORMAT_FAMILY: return a.u.mpeg.id < b.u.mpeg.id; case B_WAV_FORMAT_FAMILY: return a.u.wav.codec < b.u.wav.codec; case B_AIFF_FORMAT_FAMILY: return a.u.aiff.codec < b.u.aiff.codec; case B_AVR_FORMAT_FAMILY: return a.u.avr.id < b.u.avr.id; case B_MISC_FORMAT_FAMILY: return a.u.misc.file_format < b.u.misc.file_format || a.u.misc.codec < b.u.misc.codec; case B_META_FORMAT_FAMILY: return strncmp(a.u.meta.description, b.u.meta.description, sizeof(a.u.meta.description)) < 0; default: return true; }
add: return memcmp(&a, &b, sizeof(a)) < 0;
context: bool operator<(const media_format_description & a, const media_format_description & b){	if (a.family != b.family)		return a.family < b.family;	switch (a.family) {		case B_BEOS_FORMAT_FAMILY:			return a.u.beos.format < b.u.beos.format;		case B_QUICKTIME_FORMAT_FAMILY:			return a.u.quicktime.codec < b.u.quicktime.codec || a.u.quicktime.vendor < b.u.quicktime.vendor;		case B_AVI_FORMAT_FAMILY:			return a.u.avi.codec < b.u.avi.codec;		case B_ASF_FORMAT_FAMILY:			return a.u.asf.guid < b.u.asf.guid;		case B_MPEG_FORMAT_FAMILY:			return a.u.mpeg.id < b.u.mpeg.id;		case B_WAV_FORMAT_FAMILY:			return a.u.wav.codec < b.u.wav.codec;		case B_AIFF_FORMAT_FAMILY:			return a.u.aiff.codec < b.u.aiff.codec;		case B_AVR_FORMAT_FAMILY:			return a.u.avr.id < b.u.avr.id;		case B_MISC_FORMAT_FAMILY:			return a.u.misc.file_format < b.u.misc.file_format || a.u.misc.codec < b.u.misc.codec;		case B_META_FORMAT_FAMILY:			return strncmp(a.u.meta.description, b.u.meta.description, sizeof(a.u.meta.description)) < 0;		default:			return true;	}}