Changeset 945
- Timestamp:
- 5/2/2008 3:55:12 PM (2 years ago)
- Files:
-
- branches/mini_fusion/presentation.pdf (modified) (previous)
- branches/mini_fusion/presentation.tex (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/mini_fusion/presentation.tex
r941 r945 124 124 \end{frame} 125 125 126 \begin{frame}{Algorithms are lazily evaluated}127 \begin{itemize}128 \item Container independent algorithms - \lstinline !fusion::push_back, fusion::pop_back! etc. have 1 implementation129 \item Efficient algorithm chaining - \lstinline !filter_if<pred>(transform(push_back(cont, v), f()))! does not lead to excessive copying130 \item Permits infinite length sequences - as long as you don't need the whole thing!131 \end{itemize}132 \end{frame}133 126 134 127 \begin{frame}[fragile]{Containers} … … 143 136 \end{frame} 144 137 145 \begin{frame}[fragile]{Algorithms} 138 \begin{frame}[fragile]{Intrinsic operations} 139 \begin{lstlisting} 140 fusion::vector<int, char, std::string> my_seq( 141 101, 'a', "hello"); 142 143 std::cout << fusion::size(my_seq) << '\n'; // 3 144 std::cout << fusion::at_c<1>(my_seq) << '\n'; // 'a' 145 std::cout << *fusion::begin(my_seq) << '\n'; // 101 146 \end{lstlisting} 147 \end{frame} 148 149 \begin{frame}[fragile]{Eager algorithms} 146 150 \begin{block}{Iterator based algorithms} 147 151 \begin{lstlisting} … … 150 154 \end{block} 151 155 \pause 156 \begin{lstlisting} 157 fusion::vector<int, char, std::string> my_seq( 158 101, 'a', "hello"); 159 160 fusion::for_each(my_seq, poly_print()); 161 \end{lstlisting} 162 \end{frame} 163 164 \begin{frame}{Transforming algorithms are lazily evaluated} 165 \begin{itemize} 166 \item Container independent algorithms - \lstinline !fusion::push_back, fusion::pop_back! etc. have 1 implementation 167 \item Efficient algorithm chaining - \lstinline !filter_if<pred>(transform(push_back(cont, v), f()))! does not lead to excessive copying 168 \item Permits infinite length sequences - as long as you don't need the whole thing! 169 \end{itemize} 170 \end{frame} 171 172 \begin{frame}[fragile]{Lazy algorithms} 152 173 \begin{block}{View based algorithms} 153 174 \begin{lstlisting} 154 175 fusion::transform(my_seq, f); 155 176 \end{lstlisting} 156 \end{block} 157 \end{frame} 158 159 \begin{frame}{Fixed at compile time} 177 \pause 178 \end{block} 179 \begin{lstlisting} 180 fusion::vector<int, char, std::string> my_seq( 181 101, 'a', "hello"); 182 183 // This costs approximately nothing! 184 fusion::transform(my_seq, make_massive_vector()); 185 \end{lstlisting} 186 \end{frame} 187 188 \begin{frame}[fragile]{Fixed at compile time} 160 189 \begin{itemize} 161 190 \item The number of types in a container 191 \pause 192 \begin{lstlisting} 193 fusion::vector<int, char> my_vec(101, 'a'); 194 \end{lstlisting} 195 \pause 162 196 \item The order of types in a container 197 \pause 198 \begin{lstlisting} 199 fusion::reverse(my_vec); 200 \end{lstlisting} 201 \pause 163 202 \item Iterator positions 203 \pause 204 \begin{lstlisting} 205 fusion::begin(my_vec); 206 fusion::next(fusion::begin(my_vec)); 207 \end{lstlisting} 208 \pause 164 209 \end{itemize} 165 210 \end{frame}
