You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, the Frame trait is only implemented for [S; N] where S: Sample for N = 1-32. While realistically more than sufficient, it makes it difficult for dependent code to be generic over Frames of arbitrary N.
error[E0277]: the trait bound `[f32; CHANNELS]: Frame` is not satisfied
--> examples/bleh.rs:13:22
|
13 | do_something(&self.buffer)
| ------------ ^^^^^^^^^^^^ the trait `Frame` is not implemented for `[f32; CHANNELS]`
| |
| required by a bound introduced by this call
|
= help: the following other types implement trait `Frame`:
[S; 10]
[S; 11]
[S; 12]
[S; 13]
[S; 14]
[S; 15]
[S; 16]
[S; 17]
and 24 others
note: required by a bound in `do_something`
--> examples/bleh.rs:3:26
|
3 | fn do_something(f: &impl Frame) {
| ^^^^^ required by this bound in `do_something`
For more information about this error, try `rustc --explain E0277`.
The text was updated successfully, but these errors were encountered:
rawler
changed the title
Generic implementations of Frame over N channels
Implementt Frame generically over arbitrary N channels
Nov 5, 2022
For example, this is currently blocking a cleanup of generics in the ebur128 crate. I managed to clean up some of the code, but got stuck with the larger cleanup, partly due to missing generic implementations of Frame
rawler
changed the title
Implementt Frame generically over arbitrary N channels
Implement Frame generically over arbitrary N channels
Nov 15, 2022
Currently, the
Frame
trait is only implemented for[S; N] where S: Sample
for N = 1-32. While realistically more than sufficient, it makes it difficult for dependent code to be generic over Frames of arbitrary N.I.E. the (admittedly contrived) example of
will fail compilation with error:
The text was updated successfully, but these errors were encountered: