Changeset da81e1d0 for doc/proposals
- Timestamp:
- Nov 18, 2016, 1:47:00 PM (8 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
- Children:
- ba5131d
- Parents:
- 5a0735ac
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/proposals/virtual.txt
r5a0735ac rda81e1d0 106 106 would have many ambiguities if it did support multiple virtual parameter. 107 107 108 It is worth noting that the function pointers in these vtables are bound at object construction, rather than 109 function call-site, as in Cforall's existing polymorphic functions. As such, it is possible that two objects 110 with the same static type would have a different vtable (consider what happens if draw(line*) is overridden 111 between the definitions of two line objects). Given that the virtual drawable* erases static types though, 112 this should not be confusing in practice. A more distressing possibility is that of creating an object that 113 outlives the scope of one of the functions in its vtable. This is certainly a possible bug, but it is of a 114 type that C programmers are familiar with, and should be able to avoid by the usual methods. 115 108 116 Extensibility. 109 117 … … 145 153 146 154 These behave exactly as the previous example but all the forwarding routines are automatically generated. 155 156 Bikeshedding. 157 158 It may be desirable to add fewer new keywords than discussed in this proposal; it is possible that "virtual" 159 could replace both "vtable" and "vptr" above with unambiguous contextual meaning. However, for purposes of 160 clarity in the design discussion it is beneficial to keep the keywords for separate concepts distinct. 161
Note: See TracChangeset
for help on using the changeset viewer.