Alle boeken

Professioneel

Apps Over Coach Inloggen Begin met lezen

Computer Science · Begrippenlijst

Wat is Generic function, trait bound?

Ook bekend als: generic function · trait bound

Definition 8.3 University Computer Science — Year 2 · Hoofdstuk 8 — Traits and Generics

A generic function has type parameters, fn f<T>(...), and is checked once, for every type its parameters may take. A trait bound T: Trait restricts T to types that implement Trait, and is the only source of what the body may do with a T. Bounds are written in the angle brackets, in a where clause, or as impl Trait in a parameter’s type.

Lees in het hoofdstuk →