Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adm::CompareRtimeDurationLess broken since Time format update #164

Open
rsjbailey opened this issue Sep 15, 2022 · 0 comments
Open

adm::CompareRtimeDurationLess broken since Time format update #164

rsjbailey opened this issue Sep 15, 2022 · 0 comments

Comments

@rsjbailey
Copy link
Contributor

rsjbailey commented Sep 15, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant