Changes in / [6385d62:807ce84]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/proposals/associated_types.md
r6385d62 r807ce84 50 50 ### Nominal Inheritance ### 51 51 52 This trait specialization syntax could also be used, with a new annotation on the traits, to provide nominal inheritance of traits, e.g:52 This trait specialization syntax could also be used, with a new type of type assertion, to provide nominal inheritance of traits, e.g: 53 53 54 extern trait random_access_iterator(otype I | forward_iterator(I)) {}; 54 trait random_access_iterator(otype I | forward_iterator(I)) { 55 nominal; // not sure what the keyword is here, could maybe overload auto or extern 56 }; 55 57 56 58 forall(otype T) random_access_iterator(vector_iter(T)) {}; 57 58 I used `extern` here to not add a new keyword, I think it fits the idea of "the definition is somewhere else" of the existing meaning of `extern`. Other options include a zero-arg pseudo-trait `nominal()` that could go in the trait's constraint list.
Note: See TracChangeset
for help on using the changeset viewer.