Changes in / [7444113:6f71276]
- File:
-
- 1 edited
-
doc/generic_types/generic_types.tex (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
doc/generic_types/generic_types.tex
r7444113 r6f71276 214 214 Hence, programmers can easily form new local environments to maximize reuse of existing functions and types. 215 215 216 Finally, variables may be overloaded:216 Finally, \CFA allows variable overloading: 217 217 \lstDeleteShortInline@ 218 218 \par\smallskip … … 263 263 forall( otype T | summable( T ) ) 264 264 T sum( T a[$\,$], size_t size ) { 265 T total = { 0 };$\C{// instantiate T from 0}$265 `T` total = { `0` }; $\C{// instantiate T from 0}$ 266 266 for ( unsigned int i = 0; i < size; i += 1 ) 267 total += a[i];$\C{// select appropriate +}$267 total `+=` a[i]; $\C{// select appropriate +}$ 268 268 return total; 269 269 }
Note:
See TracChangeset
for help on using the changeset viewer.