Changeset 31f4837 for doc/theses/jiada_liang_MMath/background.tex
- Timestamp:
- May 13, 2024, 10:26:59 AM (8 weeks ago)
- Branches:
- master
- Children:
- e6f1a4b
- Parents:
- acb33f15 (diff), ca4f2b2 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/theses/jiada_liang_MMath/background.tex
racb33f15 r31f4837 74 74 However, it is restricted to integral values. 75 75 \begin{clang} 76 enum { Size = 20, Max = 10, MaxPlus10 = Max + 10, Max10Plus1, Fred = -7 };76 enum { Size = 20, Max = 10, MaxPlus10 = Max + 10, @Max10Plus1@, Fred = -7 }; 77 77 \end{clang} 78 78 Here, the aliased constants are: 20, 10, 20, 21, and -7. 79 79 Direct initialization is by a compile-time expression generating a constant value. 80 An enumerator without initializationis \newterm{auto-initialized}: from left to right, starting at zero or the next explicitly initialized constant, incrementing by @1@.80 Indirect initialization (without initialization, @Max10Plus1@) is \newterm{auto-initialized}: from left to right, starting at zero or the next explicitly initialized constant, incrementing by @1@. 81 81 Because multiple independent enumerators can be combined, enumerators with the same values can occur. 82 82 The enumerators are rvalues, so assignment is disallowed. … … 88 88 \begin{cfa} 89 89 typedef struct /* unnamed */ { ... } S; 90 struct /* unnamed */ { ... } x, y, z; 90 struct /* unnamed */ { ... } x, y, z; $\C{// questionable}$ 91 91 struct S { 92 union /* unnamed */ { 92 union /* unnamed */ { $\C{// unscoped fields}$ 93 93 int i; double d ; char ch; 94 94 }; … … 107 107 enum Week { 108 108 Thu@ = 10@, Fri, Sat, Sun, 109 Mon@ = 0@, Tue, Wed@,@ }; // terminating comma 109 Mon@ = 0@, Tue, Wed@,@ $\C{// terminating comma}$ 110 }; 110 111 \end{clang} 111 112 Note, the comma in the enumerator list can be a terminator or a separator, allowing the list to end with a dangling comma.\footnote{
Note: See TracChangeset
for help on using the changeset viewer.