- Timestamp:
 - Aug 7, 2024, 12:02:49 AM (15 months ago)
 - Branches:
 - master
 - Children:
 - f3abce9
 - Parents:
 - 43ab5fb
 - File:
 - 
      
- 1 edited
 
- 
          
  doc/theses/jiada_liang_MMath/CFAenum.tex (modified) (1 diff)
 
 
Legend:
- Unmodified
 - Added
 - Removed
 
- 
      
doc/theses/jiada_liang_MMath/CFAenum.tex
r43ab5fb r59fb462 236 236 However, the position of the underlying representation is the order of the enumerator in the new enumeration. 237 237 \begin{cfa} 238 enum() E1 { B }; 239 enum() E2 { C, D }; 240 enum() E3 { inline E1, inline E2, D };241 enum() E4 { A, inline E3, E };242 \end{cfa} 243 In the example above, @B@ has the position 0 in @E1@ and @E3@, but it at the position 0 in @E4@ as taking the 0 there.244 @C@ is at the position 0 in E2, 1 in E3 and 2 in E4. @D@ is at the position 1 in E2, 2 in E3 and 3 in E4.238 enum() E1 { B }; $\C{// B}$ 239 enum() E2 { C, D }; $\C{// C D}$ 240 enum() E3 { inline E1, inline E2, E }; $\C{// {\color{red}[\(_{E1}\)} B {\color{red}]} {\color{red}[\(_{E2}\)} C, D {\color{red}]} E}$ 241 enum() E4 { A, inline E3, F}; $\C{// A {\color{blue}[\(_{E3}\)} {\color{red}[\(_{E1}\)} B {\color{red}]} {\color{red}[\(_{E2}\)} C, D {\color{red}]} E {\color{blue}]} F }$ 242 \end{cfa} 243 In the example above, @B@ has the position 0 in @E1@ and @E3@, but it at the position 1 in @E4@ as @A@ taking the 0 in @E4@. 244 @C@ is at the position 0 in @E2@, 1 in @E3@ and 2 in E4. @D@ is at the position 1 in @E2@, 2 in @E3@ and 3 in @E4@. 245 245 246 246 A subtype enumeration can be casted, or implicitly converted into its supertype, with a @safe@ cost. Such conversion is an @enumeration conversion@.  
  Note:
 See   TracChangeset
 for help on using the changeset viewer.