Skip to content

adm::CompareRtimeDurationLess broken since Time format update #164

@rsjbailey

Description

@rsjbailey

The Rtime and Duration Comparator currently fails to compile if used:

struct CompareRtimeDurationLess {
template <typename AudioBlockFormat>
bool operator()(const AudioBlockFormat& lhs, const AudioBlockFormat& rhs) {
if (lhs.template has<Rtime>() && rhs.template has<Rtime>()) {
if (lhs.template get<Rtime>() == rhs.template get<Rtime>()) {
if (lhs.template has<Duration>() && rhs.template has<Duration>()) {
return lhs.template get<Duration>() < rhs.template get<Duration>();
}
}
return lhs.template get<Rtime>() < rhs.template get<Rtime>();
}
return false;
}
};

This tries to compare two adm::Duration objects and two adm::Rtime objects. These are both NamedTypes containing adm::Time. Neither has an operator< comparison operation defined, so attempting to use the comparator fails.

I assume the templated call operator isn't instantiated anywhere, which is why the build succeeds.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions