Changeset ff56efdf for doc/generic_types
- Timestamp:
- Aug 1, 2017, 10:40:49 PM (7 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:
- 948b0c8
- Parents:
- d6c1dd0
- Location:
- doc/generic_types
- Files:
-
- 1 deleted
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/generic_types/generic_types.tex
rd6c1dd0 rff56efdf 49 49 50 50 % Useful macros 51 \newcommand{\CFA }{C\raisebox{\depth}{\rotatebox{180}{\textsf{A}}}\hspace{-1pt}\xspace} % Cforall symbolic name52 %\newcommand{\CFA}{C$\mathbf\forall$\xspace} % Cforall symbolic name 53 \newcommand{\CC}{\ rm C\kern-.1em\hbox{+\kern-.25em+}\xspace} % C++ symbolic name54 \newcommand{\CCeleven}{\ rm C\kern-.1em\hbox{+\kern-.25em+}11\xspace} % C++11 symbolic name55 \newcommand{\CCfourteen}{\ rm C\kern-.1em\hbox{+\kern-.25em+}14\xspace} % C++14 symbolic name56 \newcommand{\CCseventeen}{\ rm C\kern-.1em\hbox{+\kern-.25em+}17\xspace} % C++17 symbolic name57 \newcommand{\CCtwenty}{\ rm C\kern-.1em\hbox{+\kern-.25em+}20\xspace} % C++20 symbolic name51 \newcommand{\CFAIcon}{\textsf{C}\raisebox{\depth}{\rotatebox{180}{\textsf{A}}}\xspace} % Cforall symbolic name 52 \newcommand{\CFA}{\protect\CFAIcon} % safe for section/caption 53 \newcommand{\CC}{\textrm{C}\kern-.1em\hbox{+\kern-.25em+}\xspace} % C++ symbolic name 54 \newcommand{\CCeleven}{\textrm{C}\kern-.1em\hbox{+\kern-.25em+}11\xspace} % C++11 symbolic name 55 \newcommand{\CCfourteen}{\textrm{C}\kern-.1em\hbox{+\kern-.25em+}14\xspace} % C++14 symbolic name 56 \newcommand{\CCseventeen}{\textrm{C}\kern-.1em\hbox{+\kern-.25em+}17\xspace} % C++17 symbolic name 57 \newcommand{\CCtwenty}{\textrm{C}\kern-.1em\hbox{+\kern-.25em+}20\xspace} % C++20 symbolic name 58 58 \newcommand{\CCV}{\rm C\kern-.1em\hbox{+\kern-.25em+}obj\xspace} % C++ virtual symbolic name 59 59 \newcommand{\Csharp}{C\raisebox{-0.7ex}{\Large$^\sharp$}\xspace} % C# symbolic name … … 443 443 This function could acquire the layout for @set(T)@ by calling its layout function with the layout of @T@ implicitly passed into the function. 444 444 445 Whether a type is concrete, dtype-static, or dynamic is decided solely on the type parameters and @forall@ clause on a declaration.446 This design allows opaque forward declarations of generic types, \eg @forall(otype T) 447 If the definition of a structure type is included in deciding whether a generic type is dynamic or concrete, some further types may be recognized as dtype-static (\eg @forall(otype T) 445 Whether a type is concrete, dtype-static, or dynamic is decided solely on the @forall@'s type parameters. 446 This design allows opaque forward declarations of generic types, \eg @forall(otype T)@ @struct Box@ -- like in C, all uses of @Box(T)@ can be separately compiled, and callers from other translation units know the proper calling conventions to use. 447 If the definition of a structure type is included in deciding whether a generic type is dynamic or concrete, some further types may be recognized as dtype-static (\eg @forall(otype T)@ @struct unique_ptr { T * p }@ does not depend on @T@ for its layout, but the existence of an @otype@ parameter means that it \emph{could}.), but preserving separate compilation (and the associated C compatibility) in the existing design is judged to be an appropriate trade-off. 448 448 449 449 … … 855 855 } 856 856 \end{lstlisting} 857 \begin{sloppypar} 857 858 Tuple expressions are then simply converted directly into compound literals, \eg @[5, 'x', 1.24]@ becomes @(_tuple3(int, char, double)){ 5, 'x', 1.24 }@. 859 \end{sloppypar} 858 860 859 861 \begin{comment}
Note: See TracChangeset
for help on using the changeset viewer.