Skip to content

Commit

Permalink
reference: vtable entries: copy @nikomatsakis's wording
Browse files Browse the repository at this point in the history
  • Loading branch information
ivan committed Feb 18, 2016
1 parent 347a257 commit 58f0d72
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/doc/reference.md
Expand Up @@ -3564,8 +3564,9 @@ Each instance of a trait object includes:
each method of `SomeTrait` that `T` implements, a pointer to `T`'s
implementation (i.e. a function pointer).

The purpose of trait objects is to permit "late binding" of methods. A call to
a method on a trait object is only resolved to a vtable entry at runtime.
The purpose of trait objects is to permit "late binding" of methods. Calling a
method on a trait object results in virtual dispatch at runtime: that is, a
function pointer is loaded from the trait object vtable and invoked indirectly.
The actual implementation for each vtable entry can vary on an object-by-object
basis.

Expand Down

0 comments on commit 58f0d72

Please sign in to comment.