</>
Plan du cours — 18/66

Génériques

Intermédiaire
fn plus_grand<T: PartialOrd + Copy>(liste: &[T]) -> T {
    let mut max = liste[0];
    for &x in liste { if x > max { max = x; } }
    max
}

struct Paire<T> { a: T, b: T }

// Clause where : plus lisible quand il y a beaucoup de contraintes
fn afficher<T>(x: T) where T: std::fmt::Display + Clone {
    println!("{x}");
}