Skip to content

Commit

Permalink
Add get_atoms() to class atoms
Browse files Browse the repository at this point in the history
This resolves a compilation issue on Windows where static casting in the set_range code has ambiguity in the overload set.
  • Loading branch information
isabelgk committed Apr 30, 2024
1 parent e2687b4 commit 1470366
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions include/c74_min_attribute.h
Original file line number Diff line number Diff line change
Expand Up @@ -504,8 +504,7 @@ namespace c74::min {

void set_range(const std::vector<T>& range) {
m_range = range;
const auto value = static_cast<atoms>(*this);
set(value);
set(get_atoms());
}


Expand Down Expand Up @@ -651,6 +650,16 @@ namespace c74::min {
}


/// Get the attribute value as a vector of atoms.
/// @return The value of the attribute

atoms get_atoms() const {
if (m_getter)
return m_getter();
else
return to_atoms(m_value);
}

/// Get the attribute value as a const reference to the native datatype.
/// We need to return by const reference in cases where the type of the attribute is a class.
/// For example, a #time_value attribute cannot be copy constructed.
Expand Down

0 comments on commit 1470366

Please sign in to comment.