├── .gitattributes ├── license.md ├── primer ├── .gitignore ├── Makefile ├── examples │ ├── Makefile │ ├── adjective.cc │ ├── advance.cc │ ├── applying.cc │ ├── average.cc │ ├── centroid.cc │ ├── checker.cc │ ├── concepts.h │ ├── defining.cc │ ├── factory.cc │ ├── factory.hh │ ├── in-place.cc │ ├── iterators.cc │ ├── matrix.cc │ ├── matrix.hh │ ├── mean.cc │ ├── misc.cc │ ├── natural.cc │ ├── point2.cc │ ├── point2.hh │ ├── ranges.cc │ ├── scratch.cc │ ├── sfinae.cc │ ├── sfinae.hh │ └── zero.cc ├── figures │ ├── .gitattributes │ ├── logical_operations.eps │ ├── logical_operations.odg │ ├── overloading.eps │ ├── overloading.odg │ └── screenshots.png ├── primer.bib ├── primer.pdf ├── primer.tex └── sections │ ├── acknowledgements.tex │ ├── concepts.tex │ ├── generic_programming.tex │ ├── introduction.tex │ ├── standard_library_concepts.tex │ ├── summary.tex │ └── terse_syntax.tex ├── readme.md └── slides ├── .gitignore ├── Makefile ├── figures ├── applying.png ├── defining.png ├── iterators.eps ├── logical.eps ├── regexs.png └── tulogo.pdf ├── slides.bib ├── slides.pdf └── slides.tex /.gitattributes: -------------------------------------------------------------------------------- 1 | *.pdf filter=lfs diff=lfs merge=lfs -text 2 | -------------------------------------------------------------------------------- /license.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | ===================== 3 | 4 | Copyright © 2018 Erik Sven Vasconcelos Jansson 5 | 6 | Permission is hereby granted, free of charge, to any person 7 | obtaining a copy of this software and associated documentation 8 | files (the “Software”), to deal in the Software without 9 | restriction, including without limitation the rights to use, 10 | copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the 12 | Software is furnished to do so, subject to the following 13 | conditions: 14 | 15 | The above copyright notice and this permission notice shall be 16 | included in all copies or substantial portions of the Software. 17 | 18 | THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, 19 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 20 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 21 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 22 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 23 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 24 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 25 | OTHER DEALINGS IN THE SOFTWARE. 26 | -------------------------------------------------------------------------------- /primer/.gitignore: -------------------------------------------------------------------------------- 1 | build 2 | polyglot 3 | 4 | *.o 5 | examples/advance 6 | examples/average 7 | examples/checker 8 | examples/centroid 9 | examples/factory 10 | examples/iterators 11 | examples/matrix 12 | examples/mean 13 | examples/misc 14 | examples/natural 15 | examples/ranges 16 | examples/scratch 17 | examples/sfinae 18 | examples/zero 19 | 20 | ## Core latex/pdflatex auxiliary files: 21 | *.aux 22 | *.lof 23 | *.log 24 | *.lot 25 | *.fls 26 | *.out 27 | *.toc 28 | *.fmt 29 | *.fot 30 | *.cb 31 | *.cb2 32 | 33 | ## Intermediate documents: 34 | *.dvi 35 | *-converted-to.* 36 | # these rules might exclude image files for figures etc. 37 | # *.ps 38 | # *.eps 39 | # *.pdf 40 | 41 | ## Bibliography auxiliary files (bibtex/biblatex/biber): 42 | *.bbl 43 | *.bcf 44 | *.blg 45 | *-blx.aux 46 | *-blx.bib 47 | *.brf 48 | *.run.xml 49 | 50 | ## Build tool auxiliary files: 51 | *.fdb_latexmk 52 | *.synctex 53 | *.synctex.gz 54 | *.synctex.gz(busy) 55 | *.pdfsync 56 | 57 | ## Auxiliary and intermediate files from other packages: 58 | # algorithms 59 | *.alg 60 | *.loa 61 | 62 | # achemso 63 | acs-*.bib 64 | 65 | # amsthm 66 | *.thm 67 | 68 | # beamer 69 | *.nav 70 | *.snm 71 | *.vrb 72 | 73 | # cprotect 74 | *.cpt 75 | 76 | # fixme 77 | *.lox 78 | 79 | #(r)(e)ledmac/(r)(e)ledpar 80 | *.end 81 | *.?end 82 | *.[1-9] 83 | *.[1-9][0-9] 84 | *.[1-9][0-9][0-9] 85 | *.[1-9]R 86 | *.[1-9][0-9]R 87 | *.[1-9][0-9][0-9]R 88 | *.eledsec[1-9] 89 | *.eledsec[1-9]R 90 | *.eledsec[1-9][0-9] 91 | *.eledsec[1-9][0-9]R 92 | *.eledsec[1-9][0-9][0-9] 93 | *.eledsec[1-9][0-9][0-9]R 94 | 95 | # glossaries 96 | *.acn 97 | *.acr 98 | *.glg 99 | *.glo 100 | *.gls 101 | *.glsdefs 102 | 103 | # gnuplottex 104 | *-gnuplottex-* 105 | 106 | # hyperref 107 | *.brf 108 | 109 | # knitr 110 | *-concordance.tex 111 | # TODO Comment the next line if you want to keep your tikz graphics files 112 | *.tikz 113 | *-tikzDictionary 114 | 115 | # listings 116 | *.lol 117 | 118 | # makeidx 119 | *.idx 120 | *.ilg 121 | *.ind 122 | *.ist 123 | 124 | # minitoc 125 | *.maf 126 | *.mlf 127 | *.mlt 128 | *.mtc 129 | *.mtc[0-9] 130 | *.mtc[1-9][0-9] 131 | 132 | # minted 133 | _minted* 134 | *.pyg 135 | 136 | # morewrites 137 | *.mw 138 | 139 | # mylatexformat 140 | *.fmt 141 | 142 | # nomencl 143 | *.nlo 144 | 145 | # sagetex 146 | *.sagetex.sage 147 | *.sagetex.py 148 | *.sagetex.scmd 149 | 150 | # sympy 151 | *.sout 152 | *.sympy 153 | sympy-plots-for-*.tex/ 154 | 155 | # pdfcomment 156 | *.upa 157 | *.upb 158 | 159 | # pythontex 160 | *.pytxcode 161 | pythontex-files-*/ 162 | 163 | # thmtools 164 | *.loe 165 | 166 | # TikZ & PGF 167 | *.dpth 168 | *.md5 169 | *.auxlock 170 | 171 | # todonotes 172 | *.tdo 173 | 174 | # easy-todo 175 | *.lod 176 | 177 | # xindy 178 | *.xdy 179 | 180 | # xypic precompiled matrices 181 | *.xyc 182 | 183 | # endfloat 184 | *.ttt 185 | *.fff 186 | 187 | # Latexian 188 | TSWLatexianTemp* 189 | 190 | ## Editors: 191 | # WinEdt 192 | *.bak 193 | *.sav 194 | 195 | # Texpad 196 | .texpadtmp 197 | 198 | # Kile 199 | *.backup 200 | 201 | # KBibTeX 202 | *~[0-9]* 203 | -------------------------------------------------------------------------------- /primer/Makefile: -------------------------------------------------------------------------------- 1 | name := primer 2 | viewer := mupdf 3 | 4 | sections := $(wildcard sections/*.tex) 5 | 6 | all: $(name).pdf 7 | view: $(name).pdf 8 | $(viewer) $(name).pdf 9 | $(name).pdf: $(name).tex $(sections) $(name).bib 10 | mkdir -p build 11 | pdflatex -output-directory build/ $(name) 12 | bibtex build/$(name) 13 | pdflatex -output-directory build/ $(name) 14 | pdflatex -output-directory build/ $(name) 15 | mv build/$(name).pdf . 16 | polyglot: polyglot/$(name).pdf 17 | polyglot/$(name).zip: FORCE 18 | mkdir -p polyglot 19 | make -C examples distclean 20 | zip -r polyglot/$(name).zip examples 21 | # You found it Arthur! :) polyglot PDF from PoC||GTFO. 22 | polyglot/$(name).pdf: $(name).pdf polyglot/$(name).zip 23 | cat $(name).pdf polyglot/$(name).zip > polyglot/$(name).pdf 24 | zip -A polyglot/$(name).pdf 25 | distribute: distclean all polyglot 26 | cp polyglot/$(name).pdf concepts-primer.pdf 27 | clean: 28 | rm -rf build 29 | distclean: clean 30 | rm -rf polyglot 31 | rm -f $(name).pdf 32 | .PHONY: all clean 33 | FORCE: 34 | -------------------------------------------------------------------------------- /primer/examples/Makefile: -------------------------------------------------------------------------------- 1 | CXXFLAGS := -std=c++17 -fconcepts -Wall -Wextra -Wpedantic 2 | LDLIBS := -lstdc++ 3 | 4 | all: scratch mean centroid average sfinae factory advance matrix iterators ranges natural zero misc 5 | check: checker 6 | @./checker 7 | 8 | gcc-test: check 9 | 10 | checker: checker.o 11 | checker.o: checker.cc 12 | scratch: scratch.o 13 | scratch.o: scratch.cc 14 | 15 | point2.o: point2.cc point2.hh 16 | 17 | mean: mean.o 18 | mean.o: mean.cc 19 | centroid: centroid.o point2.o 20 | centroid.o: centroid.cc 21 | average: average.o point2.o 22 | average.o: average.cc 23 | sfinae.o: sfinae.cc sfinae.hh 24 | sfinae: sfinae.o 25 | factory: factory.o 26 | factory.o: factory.cc factory.hh 27 | matrix.o: matrix.cc matrix.hh 28 | matrix: matrix.o 29 | advance: advance.o 30 | advance.o: advance.cc 31 | iterators: iterators.o 32 | iterators.o: iterators.cc 33 | natural.o: natural.cc 34 | natural: natural.o 35 | ranges.o: ranges.cc 36 | ranges: ranges.o 37 | zero.o: zero.cc 38 | zero: zero.o 39 | misc.o: misc.cc 40 | misc: misc.o 41 | 42 | clean: .FORCE 43 | @rm -f *.o 44 | distclean: clean 45 | @rm -f checker scratch mean point2 centroid average sfinae factory advance matrix iterators ranges natural zero misc 46 | 47 | # These are not the dependencies you are looking for 48 | # - Obi-Wan Kenobi, Star Wars IV. 49 | .PHONY: all check clean distclean 50 | # Use the force, Luke! 51 | .FORCE: 52 | -------------------------------------------------------------------------------- /primer/examples/adjective.cc: -------------------------------------------------------------------------------- 1 | #include "concepts.h" 2 | 3 | #include 4 | #include 5 | 6 | 7 | template 8 | void sort(Range& range); 9 | 10 | void sort(Sortable auto& range); 11 | 12 | template 13 | void sort(Iterator begin, Iterator end); 14 | 15 | template 16 | requires Mergeable 17 | Out merge(In1 f1, In1 l1, In2 f2, In2 l2, Out out); 18 | 19 | 20 | template 21 | auto square_even() { 22 | return N*N; 23 | } 24 | 25 | int main(int, char**) { 26 | 27 | #if true // Replace with 'false'! 28 | std::list l { 1, 2, 3, 4, 5 }; 29 | #else 30 | // Won't compile! ForwardIterator does 31 | // not satisfy BidirectionalIterator! 32 | std::forward_list l { 1, 2, 3, 4, 5 }; 33 | #endif 34 | 35 | #if false 36 | 37 | BidirectionalIterator auto iterator = l.begin(); 38 | 39 | #endif 40 | 41 | return 0; 42 | } 43 | -------------------------------------------------------------------------------- /primer/examples/advance.cc: -------------------------------------------------------------------------------- 1 | #include "concepts.h" 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | // Our version of advance only goes forward. Not 10 | // the same as std::advance, which can advance a 11 | // iterator both forwards & backward. Different! 12 | 13 | template 14 | void tagged_advance(T& iterator, U distance, 15 | std::forward_iterator_tag) { 16 | while (distance--) 17 | iterator++; 18 | } 19 | 20 | template 21 | void tagged_advance(T& iterator, U distance, 22 | std::bidirectional_iterator_tag) { 23 | std::forward_iterator_tag hack_category; 24 | tagged_advance(iterator, distance, hack_category); 25 | } 26 | 27 | template 28 | void tagged_advance(T& iterator, const U distance, 29 | std::random_access_iterator_tag) { 30 | iterator += distance; 31 | } 32 | 33 | #if false // Below and above is the way we do advance using tag dispatch! 34 | // Example based on a Boost post on: Tag Dispatch in Generic Programming. 35 | 36 | template 37 | void advance(T& iterator, U distance) { 38 | typename std::iterator_traits::category category; 39 | tagged_advance(iterator, distance, category); 40 | } 41 | 42 | #endif 43 | 44 | // Here we use constraints instead, notice that this is a lot nicer now! 45 | // Notice that we also additionally check that distances are an integer. 46 | 47 | template 48 | requires ForwardIterator && 49 | Unsigned && Integral 50 | void advance(T& iterator, U distance) { 51 | std::cout << "forward" << std::endl; 52 | while (distance--) 53 | ++iterator; 54 | } 55 | 56 | template 57 | requires RandomAccessIterator && 58 | Unsigned && Integral 59 | void advance(T& iterator, U distance) { 60 | std::cout << "random!" << std::endl; 61 | iterator += distance; 62 | } 63 | 64 | int main(int, char**) { 65 | 66 | std::forward_list f { 1, 2, 3, 4, 5 }; 67 | ForwardIterator fi { f.begin() }; 68 | advance(fi, 2u); 69 | std::cout << *(fi) << std::endl; 70 | 71 | std::list l { 1, 2, 3, 4, 5 }; 72 | 73 | // List does not fullfill RandomAccess. 74 | // Try replacing with RandomAccessIt to 75 | // see a nice error message telling you 76 | // that std::list isn't RandomAccess :) 77 | BidirectionalIterator li { l.begin() }; 78 | advance(li, 2u); 79 | std::cout << *(li) << std::endl; 80 | 81 | std::vector v { 1, 2, 3, 4, 5 }; 82 | RandomAccessIterator vi { v.begin() }; 83 | advance(vi, 2u); 84 | std::cout << *(vi) << std::endl; 85 | 86 | return 0; 87 | } 88 | -------------------------------------------------------------------------------- /primer/examples/applying.cc: -------------------------------------------------------------------------------- 1 | #include "concepts.h" 2 | 3 | 4 | 5 | int main(int, char**) { 6 | return 0; 7 | } 8 | -------------------------------------------------------------------------------- /primer/examples/average.cc: -------------------------------------------------------------------------------- 1 | #include "concepts.h" 2 | #include "point2.hh" 3 | 4 | #include 5 | #include 6 | 7 | template 8 | requires DefaultConstructible && 9 | SummableWith && 10 | ScalableWith 11 | T average(const T* begin, 12 | const T* const end) { 13 | T sum { }; 14 | const double size = end - begin; 15 | while (begin != end) 16 | sum += *begin++; 17 | return sum / size; 18 | } 19 | 20 | int main(int, char**) { 21 | 22 | double numbers[] { 1, 2, 3, 4, 5 }; 23 | auto numbers_size { sizeof(numbers) / sizeof(double) }; 24 | std::cout << average(numbers, numbers + numbers_size) 25 | << std::endl; 26 | 27 | point2 points[] { { -1, +1 }, { +1, +1 }, 28 | { -1, -1 }, { +1, -1 } }; 29 | auto points_size = sizeof(points) / sizeof(point2); 30 | std::cout << average(points, points + points_size) 31 | << std::endl; 32 | 33 | #if false // switch to 'true' to see an error message! 34 | 35 | std::string strings[] { "1", "2", "3", "4", "5" }; 36 | auto strings_size = sizeof(strings) / sizeof(std::string); 37 | std::cout << average(strings, strings + strings_size) 38 | << std::endl; 39 | 40 | #endif 41 | 42 | return 0; 43 | } 44 | -------------------------------------------------------------------------------- /primer/examples/centroid.cc: -------------------------------------------------------------------------------- 1 | #include "point2.hh" 2 | 3 | #include 4 | 5 | point2 centroid(const point2* begin, 6 | const point2* const end) { 7 | point2 sum { }; 8 | const double size = end - begin; 9 | while (begin != end) 10 | sum += *begin++; 11 | return sum / size; 12 | } 13 | 14 | int main(int, char**) { 15 | 16 | point2 points[] { { -1, +1 }, { +1, +1 }, 17 | { -1, -1 }, { +1, -1 } }; 18 | auto points_size = sizeof(points) / sizeof(point2); 19 | std::cout << centroid(points, points + points_size) 20 | << std::endl; 21 | 22 | return 0; 23 | } 24 | -------------------------------------------------------------------------------- /primer/examples/checker.cc: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include "concepts.h" 6 | 7 | int main(int, char**) { 8 | #ifndef __cpp_concepts 9 | // Will only work in GCC-based compilers, but seems 10 | // no other compilers supports concept lite anyway. 11 | static_assert(false, "No concepts support found!"); 12 | #endif 13 | 14 | // For those interested in "neat" terminal effects: 15 | // "\x1B[32;1m" - is the bright green terminal code 16 | // "\x1B[0m\r" - is for the "clear any color" code 17 | // ^^---- is the "carriage return" and will 18 | // in most shells, "clear" this row. 19 | // Finally, you just sleep inbetween call to these. 20 | // Tip: replaces the need for ncurse in many cases. 21 | 22 | for (std::size_t i { 0 }; i < 3; ++i) { 23 | std::cout << "\x1B[32;1m" 24 | << "---------| |---------" 25 | << "\x1B[0m\r" << std::flush; 26 | std::this_thread::sleep_for(std::chrono::seconds(1)); 27 | std::cout << "\x1B[32;1m" 28 | << "---------| Ready to Roll |---------" 29 | << "\x1B[0m\r" << std::flush; 30 | std::this_thread::sleep_for(std::chrono::seconds(1)); 31 | } 32 | 33 | std::cout << "\x1B[32;1m" 34 | << "---------| Ready to Roll |---------" 35 | << "\x1B[0m" << std::endl; 36 | 37 | return 0; 38 | } 39 | -------------------------------------------------------------------------------- /primer/examples/concepts.h: -------------------------------------------------------------------------------- 1 | #ifndef CONCEPTS_PRIMER_H 2 | #define CONCEPTS_PRIMER_H 3 | 4 | // Copyright © 2018 Erik Sven Vasconcelos Jansson 5 | // 6 | // Permission is hereby granted, free of charge, to any person 7 | // obtaining a copy of this software and associated documentation 8 | // files (the “Software”), to deal in the Software without 9 | // restriction, including without limitation the rights to use, 10 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the 12 | // Software is furnished to do so, subject to the following 13 | // conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be 16 | // included in all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, 19 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 20 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 21 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 22 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 23 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 24 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 25 | // OTHER DEALINGS IN THE SOFTWARE. 26 | // 27 | // WARNING: these concepts are non-standard and probably also not 28 | // complete. When the and header are available, 29 | // go and use those instead. These are only here for teaching, and 30 | // should probably not be used in production. Here be dragons!!!! 31 | 32 | #include 33 | #include 34 | 35 | #define concept concept bool 36 | 37 | template concept Same = std::is_same_v; 38 | template concept Integral = std::is_integral_v; 39 | template concept Floating = std::is_floating_point_v; 40 | template concept Number = Integral || Floating; 41 | 42 | template 43 | concept DefaultConstructible = requires { 44 | T(); 45 | T{}; 46 | }; 47 | 48 | template 49 | concept SwappableWith = requires(T x, U y) { 50 | { std::swap(x, y) } noexcept; 51 | { std::swap(y, x) } noexcept; 52 | }; 53 | 54 | template 55 | concept Swappable = SwappableWith; 56 | 57 | template 58 | concept EqualityComparableWith = requires(T x, U y) { 59 | { x == y } -> bool; 60 | { x != y } -> bool; 61 | { y != x } -> bool; 62 | { y == x } -> bool; 63 | }; 64 | 65 | template 66 | concept EqualityComparable = EqualityComparableWith; 67 | 68 | template 69 | concept StrictTotallyOrderedWith = requires(T x, U y) { 70 | { x > y } -> bool; { x >= y } -> bool; 71 | { x <= y } -> bool; { x < y } -> bool; 72 | { y > x } -> bool; { y >= x } -> bool; 73 | { y <= x } -> bool; { y < x } -> bool; 74 | } && EqualityComparableWith; 75 | 76 | template 77 | concept StrictTotallyOrdered = StrictTotallyOrderedWith; 78 | 79 | template 80 | concept SummableWith = requires(T x, T y) { 81 | { x + y } -> T; 82 | { x += y } -> T&; 83 | { y += x } -> T&; 84 | { y + x } -> T; 85 | }; 86 | 87 | template 88 | concept Summable = SummableWith; 89 | 90 | template 91 | concept SubtractableWith = requires(T x, T y) { 92 | { x - y } -> T; 93 | { x -= y } -> T&; 94 | { y -= x } -> T&; 95 | { y - x } -> T; 96 | }; 97 | 98 | template 99 | concept Subtractable = SubtractableWith; 100 | 101 | template 102 | concept ScalableWith = requires(T x, U y) { 103 | { x * y } -> T; 104 | { x *= y } -> T&; 105 | { y * x } -> T; 106 | { x /= y } -> T&; 107 | { x / y } -> T; 108 | 109 | }; 110 | 111 | template 112 | concept WeaklyIncrementable = requires(T x) { 113 | { ++x } -> T&; 114 | { x++ } -> T; 115 | }; 116 | 117 | template 118 | concept WeaklyDecrementable = requires(T x) { 119 | { --x } -> T&; 120 | { x-- } -> T; 121 | }; 122 | 123 | template 124 | concept WeaklyRandomAccess = requires(T x, std::size_t n) { 125 | { x += n } -> T&; 126 | { x -= n } -> T&; 127 | }; 128 | 129 | template 130 | concept ReadableIterator = requires(T x) { 131 | { *x } -> typename std::iterator_traits::reference; 132 | }; 133 | 134 | template 135 | concept IteratorTraits = requires { 136 | typename std::iterator_traits::value_type; 137 | typename std::iterator_traits::difference_type; 138 | typename std::iterator_traits::reference; 139 | typename std::iterator_traits::pointer; 140 | typename std::iterator_traits::iterator_category; 141 | }; 142 | 143 | template concept EqualTo = (N == M); 144 | template concept NotEqualTo = (N != M); 145 | template concept GreaterThan = (N > M); 146 | template concept LessThan = (N < M); 147 | template concept Even = ((N % 2) == 0); 148 | template concept Odd = !(Even); 149 | 150 | #if false // Not a good way to write 151 | 152 | template 153 | concept ForwardIterator = requires { 154 | T(); 155 | T{}; 156 | } && requires { 157 | typename std::iterator_traits::value_type; 158 | typename std::iterator_traits::difference_type; 159 | typename std::iterator_traits::reference; 160 | typename std::iterator_traits::pointer; 161 | typename std::iterator_traits::iterator_category; 162 | } && requires(T x) { 163 | { *x } -> typename std::iterator_traits::reference; 164 | { ++x } -> T&; 165 | { x++ } -> T; 166 | } && requires(T x, T y) { 167 | { std::swap(x, y) } noexcept; 168 | { std::swap(y, x) } noexcept; 169 | } && EqualityComparable; 170 | 171 | #endif 172 | 173 | // That's better! :) 174 | 175 | template 176 | concept ForwardIterator = DefaultConstructible && 177 | IteratorTraits && 178 | ReadableIterator && 179 | WeaklyIncrementable && 180 | Swappable; 181 | 182 | template 183 | concept BidirectionalIterator = ForwardIterator && 184 | WeaklyDecrementable; 185 | 186 | template 187 | // Not complete, there is a lot more machinery going on... 188 | concept RandomAccessIterator = BidirectionalIterator && 189 | WeaklyRandomAccess; 190 | 191 | template 192 | concept Allocatable = requires(T x, std::size_t n) { 193 | requires Same; 194 | { x.~T } noexcept; 195 | requires Same; 196 | requires Same; 197 | { delete new T[n] }; 198 | { delete new T }; 199 | }; 200 | 201 | template concept Unsigned = std::is_unsigned_v; 202 | template concept Signed = std::is_signed_v; 203 | 204 | // Below are just a couple of "skeleton" concepts, mainly 205 | // used in the Zero, Natural, In-Place, Adjective example. 206 | 207 | template 208 | concept Sortable = true; 209 | template 210 | concept Mergeable = true; 211 | 212 | #endif 213 | -------------------------------------------------------------------------------- /primer/examples/defining.cc: -------------------------------------------------------------------------------- 1 | #include "concepts.h" 2 | 3 | 4 | 5 | int main(int, char**) { 6 | return 0; 7 | } 8 | -------------------------------------------------------------------------------- /primer/examples/factory.cc: -------------------------------------------------------------------------------- 1 | #include "factory.hh" 2 | 3 | #include 4 | 5 | int main(int, char**) { 6 | 7 | NumberFactory deep_factory { 1984 }; 8 | NumberFactory beef_factory { 3.141592 }; 9 | 10 | std::cout << deep_factory.create_number() 11 | << std::endl; 12 | std::cout << beef_factory.create_number() 13 | << std::endl; // negative value 14 | 15 | return 0; 16 | } 17 | -------------------------------------------------------------------------------- /primer/examples/factory.hh: -------------------------------------------------------------------------------- 1 | #ifndef FACTORY_HH 2 | #define FACTORY_HH 3 | 4 | #include 5 | 6 | #if false 7 | 8 | struct NumberFactory { 9 | enum { INTEGRAL, FLOATING } number_type; 10 | 11 | template>> 14 | NumberFactory(T) : number_type { INTEGRAL } {} 15 | 16 | int create_number() const; 17 | 18 | template>> 21 | NumberFactory(T) : number_type { FLOATING } {} 22 | }; 23 | 24 | #endif 25 | 26 | #if false 27 | 28 | struct NumberFactory { 29 | enum { INTEGRAL, FLOATING } number_type; 30 | 31 | template struct dummy { dummy(int) {} }; 32 | 33 | template>> 36 | NumberFactory(T, dummy<0>=0) : number_type { INTEGRAL } {} 37 | 38 | int create_number() const; 39 | 40 | template>> 43 | NumberFactory(T, dummy<1>=0) : number_type { FLOATING } {} 44 | }; 45 | 46 | #endif 47 | 48 | #if true 49 | 50 | struct NumberFactory { 51 | enum { INTEGRAL, FLOATING } number_type; 52 | 53 | template 54 | requires std::is_integral_v 55 | NumberFactory(T) : number_type { INTEGRAL } {} 56 | 57 | int create_number() const; 58 | 59 | template 60 | requires std::is_floating_point_v 61 | NumberFactory(T) : number_type { FLOATING } {} 62 | }; 63 | 64 | #endif 65 | 66 | int NumberFactory::create_number() const { 67 | if (number_type == INTEGRAL) 68 | return 42; 69 | else return 0xDEADBEEF; 70 | } 71 | 72 | #endif 73 | -------------------------------------------------------------------------------- /primer/examples/in-place.cc: -------------------------------------------------------------------------------- 1 | #include "concepts.h" 2 | 3 | #include 4 | #include 5 | 6 | 7 | template 8 | void sort(Range& range); 9 | 10 | void sort(Sortable{}& range); 11 | 12 | 13 | void sort(RandomAccessIterator{Iterator} begin, 14 | Iterator end); 15 | 16 | template 17 | Out merge(In1 f1, In1 l1, In2 f2, In2 l2, Out out); 18 | 19 | 20 | template 21 | auto square_even() { 22 | return N*N; 23 | } 24 | 25 | int main(int, char**) { 26 | 27 | #if true // Replace with 'false'! 28 | std::list l { 1, 2, 3, 4, 5 }; 29 | #else 30 | // Won't compile! ForwardIterator does 31 | // not satisfy BidirectionalIterator! 32 | std::forward_list l { 1, 2, 3, 4, 5 }; 33 | #endif 34 | 35 | #if false 36 | 37 | BidirectionalIterator{Iterator} iterator = l.begin(); 38 | 39 | #endif 40 | 41 | return 0; 42 | } 43 | -------------------------------------------------------------------------------- /primer/examples/iterators.cc: -------------------------------------------------------------------------------- 1 | #include "concepts.h" 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | int main(int, char**) { 8 | 9 | std::forward_list fl { 1, 2, 3, 4, 5 }; 10 | ForwardIterator fi { fl.begin() }; 11 | 12 | std::list bl { 1, 2, 3, 4, 5 }; 13 | BidirectionalIterator bi { bl.begin() }; 14 | 15 | std::vector ra { 1, 2, 3, 4, 5 }; 16 | RandomAccessIterator ri { ra.begin() }; 17 | 18 | ForwardIterator af { bl.begin() }; 19 | 20 | #if false // neither of these will compile!! 21 | 22 | BidirectionalIterator nb { fl.begin() }; 23 | RandomAccessIterator nr { bl.begin() }; 24 | 25 | #endif 26 | 27 | return 0; 28 | } 29 | -------------------------------------------------------------------------------- /primer/examples/matrix.cc: -------------------------------------------------------------------------------- 1 | #include "matrix.hh" 2 | 3 | #include 4 | #include 5 | 6 | int main(int, char**) { 7 | 8 | Matrix n { 1, 0, 9 | 0, 1 }; 10 | Matrix m { 0, 1, 11 | 1, 0 }; 12 | std::cout << n << std::endl; 13 | n += m; // Element-wise add. 14 | std::cout << n << std::endl; 15 | n -= m; // Element-wise sum. 16 | std::cout << n << std::endl; 17 | n *= 5; // Scalar multiplier 18 | std::cout << n << std::endl; 19 | n = n *= m; // Dot product!! 20 | std::cout << n << std::endl; 21 | 22 | #if false // Set to 'true' fail. 23 | Matrix s; 24 | #endif 25 | 26 | return 0; 27 | } 28 | -------------------------------------------------------------------------------- /primer/examples/matrix.hh: -------------------------------------------------------------------------------- 1 | #ifndef MATRIX_HH 2 | #define MATRIX_HH 3 | 4 | #include "concepts.h" 5 | 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | 12 | // Not fully tested code, should *not* 13 | // be used in production, or even in a 14 | // hobby project. This is just to show 15 | // that constraints can be applied for 16 | // other things than function as well! 17 | 18 | template 20 | requires Number 21 | class Matrix { 22 | public: 23 | Matrix() = default; 24 | Matrix(std::initializer_list list) { 25 | if (list.size() != data.size()) 26 | throw std::out_of_range { "Non-matching matrix initializer!" }; 27 | std::copy(list.begin(), list.end(), 28 | data.begin()); 29 | } 30 | 31 | constexpr std::size_t rows() const { return R; } 32 | constexpr std::size_t columns() const { return C; } 33 | constexpr std::size_t size() const { return R*C; } 34 | 35 | T& operator()(std::size_t row, std::size_t column) { 36 | if (row >= R || column >= C) 37 | throw std::out_of_range { "Faulty index!" }; 38 | return data[row*C + column]; 39 | } 40 | 41 | T operator()(std::size_t row, std::size_t column) const { 42 | if (row >= R || column >= C) 43 | throw std::out_of_range { "Faulty index!" }; 44 | return data[row*C + column]; 45 | } 46 | 47 | 48 | // Again, this could all probably be done better. This is 49 | // just an example after all :). If you find some example 50 | // that is more clear +- elegant, create a PR and fix it! 51 | 52 | template 53 | requires ScalableWith && Number 54 | Matrix& operator*=(U scalar) { 55 | std::for_each(data.begin(), data.end(), 56 | [scalar](T& element) { 57 | element *= scalar; 58 | }); 59 | 60 | return *this; 61 | } 62 | 63 | template 64 | requires SummableWith && Number 65 | Matrix& operator+=(U scalar) { 66 | std::for_each(data.begin(), data.end(), 67 | [scalar](T& element) { 68 | element += scalar; 69 | }); 70 | 71 | return *this; 72 | } 73 | 74 | template 75 | requires SubtractableWith && Number 76 | Matrix& operator-=(U scalar) { 77 | std::for_each(data.begin(), data.end(), 78 | [scalar](T& element) { 79 | element -= scalar; 80 | }); 81 | 82 | return *this; 83 | } 84 | 85 | Matrix& operator*=(const Matrix& matrix) { 86 | for (std::size_t i { 0 }; i < matrix.size(); ++i) 87 | data[i] *= matrix.data[i]; 88 | return *this; 89 | } 90 | 91 | Matrix& operator+=(const Matrix& matrix) { 92 | for (std::size_t i { 0 }; i < matrix.size(); ++i) 93 | data[i] += matrix.data[i]; 94 | return *this; 95 | } 96 | 97 | Matrix& operator-=(const Matrix& matrix) { 98 | for (std::size_t i { 0 }; i < matrix.size(); ++i) 99 | data[i] -= matrix.data[i]; 100 | return *this; 101 | } 102 | 103 | Matrix transpose() const { 104 | Matrix matrix; 105 | // Not a good implementation. Can you figure 106 | // out why? :) Do you remember comp-sci 101? 107 | for (std::size_t i { 0 }; i < R; ++i) { 108 | for (std::size_t j { 0 }; j < C; ++j) { 109 | matrix(j, i) = (*this)(i, j); 110 | } 111 | } 112 | } 113 | 114 | template 115 | Matrix dot(const Matrix& matrix) { 116 | Matrix temporary; 117 | for (std::size_t i { 0 }; i < R; ++i) { 118 | for (std::size_t k { 0 }; k < K; ++k) { 119 | T sum { }; 120 | for (std::size_t j { 0 }; j < C; ++j) 121 | sum += (*this)(i,j) * matrix(j,k); 122 | temporary(i,k) = sum; 123 | } 124 | } 125 | 126 | return temporary; 127 | } 128 | 129 | // More operations, like cross products etc.. Should 130 | // be defined for this to be a more complete matrix. 131 | 132 | private: 133 | std::array data; // Might be bad b.c. we'll 134 | // run out of stack space if we aren't careful. The 135 | // good way to do this would be to choose depending 136 | // on the amounts of elements if we should allocate 137 | // on the stack or on the heap. Simplicity for now. 138 | }; 139 | 140 | template 141 | std::ostream& operator<<(std::ostream& stream, 142 | const Matrix& matrix) { 143 | for (std::size_t i { 0 }; i < R; ++i) { 144 | for (std::size_t j { 0 }; j < C; ++j) { 145 | stream << matrix(i, j) << " "; 146 | } stream << '\n'; 147 | } 148 | 149 | return stream; 150 | } 151 | 152 | #endif 153 | -------------------------------------------------------------------------------- /primer/examples/mean.cc: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | double mean(const double* begin, 4 | const double* const end) { 5 | double sum { }; 6 | const double size = end - begin; 7 | while (begin != end) 8 | sum += *begin++; 9 | return sum / size; 10 | } 11 | 12 | int main(int, char**) { 13 | 14 | double numbers[] { 1, 2, 3, 4, 5 }; 15 | auto numbers_size { sizeof(numbers) / sizeof(double) }; 16 | std::cout << mean(numbers, numbers + numbers_size) 17 | << std::endl; 18 | 19 | return 0; 20 | } 21 | -------------------------------------------------------------------------------- /primer/examples/misc.cc: -------------------------------------------------------------------------------- 1 | #include "concepts.h" 2 | 3 | #include 4 | #include 5 | 6 | template typename C, typename T> 7 | requires Summable 8 | T sum(const C& container) { 9 | T total_sum { }; 10 | for (auto value : container) 11 | total_sum += value; 12 | return total_sum; 13 | } 14 | 15 | template typename C, typename T> 16 | requires Integral || Floating 17 | T sum_numbers(const C& container) requires Summable { 18 | T total_sum { }; 19 | for (auto value : container) 20 | total_sum += value; 21 | return total_sum; 22 | } 23 | 24 | template 25 | requires Even 26 | int square_even() { 27 | return N*N; 28 | } 29 | 30 | template 31 | requires Even && 32 | Number 33 | int square_only_even_numbers() { 34 | return N*N; 35 | } 36 | 37 | 38 | 39 | 40 | 41 | 42 | // Just read The Hitchhiker's Guide! 43 | constexpr bool the_answer(int value) { 44 | return value == 42; 45 | } 46 | 47 | template 48 | requires the_answer(N) 49 | void check_with_deep_thought() { 50 | std::cout << "good guess!" 51 | << std::endl; 52 | } 53 | 54 | int main(int, char**) { 55 | 56 | std::cout << square_even<4>() << std::endl; 57 | // square_even<3>(); // will fail, 3 isn't Even! 58 | 59 | std::vector v { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }; 60 | std::cout << sum(v) << std::endl; // will be 55. 61 | 62 | std::vector vs { "1", "2", "3" }; 63 | // std::cout << sum_numbers(vs) << std::endl; :( 64 | // constraints not satisfied: std::string is not 65 | // a Number, and doesn't support the % operator. 66 | 67 | check_with_deep_thought<42>(); 68 | 69 | return 0; 70 | } 71 | -------------------------------------------------------------------------------- /primer/examples/natural.cc: -------------------------------------------------------------------------------- 1 | #include "concepts.h" 2 | 3 | #include 4 | #include 5 | 6 | 7 | template 8 | void sort(Range& range); 9 | 10 | void sort(Sortable& range); 11 | 12 | 13 | void sort(RandomAccessIterator begin, 14 | RandomAccessIterator end); 15 | 16 | Mergeable{In1, In2, Out} 17 | Out merge(In1 f1, In1 l1, In2 f2, In2 l2, Out out); 18 | 19 | 20 | template 21 | auto square_even() { 22 | return N*N; 23 | } 24 | 25 | int main(int, char**) { 26 | 27 | #if true // Replace with 'false'! 28 | std::list l { 1, 2, 3, 4, 5 }; 29 | #else 30 | // Won't compile! ForwardIterator does 31 | // not satisfy BidirectionalIterator! 32 | std::forward_list l { 1, 2, 3, 4, 5 }; 33 | #endif 34 | 35 | #if false 36 | 37 | BidirectionalIterator iterator = l.begin(); 38 | 39 | #endif 40 | 41 | return 0; 42 | } 43 | -------------------------------------------------------------------------------- /primer/examples/point2.cc: -------------------------------------------------------------------------------- 1 | #include "point2.hh" 2 | 3 | point2& point2::operator/=(const double scalar) { 4 | x /= scalar; 5 | y /= scalar; 6 | return *this; 7 | } 8 | 9 | point2& point2::operator*=(const double scalar) { 10 | x *= scalar; 11 | y *= scalar; 12 | return *this; 13 | } 14 | 15 | point2& point2::operator+=(const point2& point) { 16 | x += point.x; 17 | y += point.y; 18 | return *this; 19 | } 20 | 21 | point2 operator+(const point2& p1, const point2& p2) { 22 | point2 temporary { p1 }; 23 | temporary += p2; 24 | return temporary; 25 | } 26 | 27 | point2 operator/(const point2& point, const double scalar) { 28 | point2 temporary { point }; 29 | temporary /= scalar; 30 | return temporary; 31 | } 32 | 33 | point2 operator*(const point2& point, const double scalar) { 34 | point2 temporary { point }; 35 | temporary *= scalar; 36 | return temporary; 37 | } 38 | 39 | point2 operator*(const double scalar, const point2& point) { 40 | point2 temporary { point }; 41 | temporary *= scalar; 42 | return temporary; 43 | } 44 | 45 | std::ostream& operator<<(std::ostream& stream, const point2& point) { 46 | stream << '(' << point.x << "," 47 | << point.y << ')'; 48 | return stream; 49 | } 50 | -------------------------------------------------------------------------------- /primer/examples/point2.hh: -------------------------------------------------------------------------------- 1 | #ifndef POINT2_HH 2 | #define POINT2_HH 3 | 4 | #include 5 | 6 | struct point2 { 7 | double x, y; 8 | point2& operator/=(const double); 9 | point2& operator*=(const double); 10 | point2& operator+=(const point2&); 11 | }; 12 | 13 | point2 operator+(const point2&, const point2&); 14 | point2 operator/(const point2&, const double); 15 | point2 operator*(const point2&, const double); 16 | point2 operator*(const double, const point2&); 17 | 18 | std::ostream& operator<<(std::ostream&, const point2&); 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /primer/examples/ranges.cc: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | using namespace ranges; 9 | 10 | template 11 | void print_all_elements(T& container, std::ostream& stream) { 12 | for (auto element : container) 13 | stream << element << " "; 14 | stream << std::endl; 15 | } 16 | 17 | int main(int, char**) { 18 | 19 | std::vector v { 10, 2, 6, 10, 4, 1, 9, 5, 8, 3 }; 20 | v = std::move(v) | action::sort | action::unique; 21 | print_all_elements(v, std::cout); 22 | 23 | auto range_of_v = v | view::remove_if([](int i) { return i % 2 == 1; }) 24 | | view::transform([](int i) { return std::to_string(i); }) 25 | | view::take(4); 26 | print_all_elements(range_of_v, std::cout); 27 | 28 | return 0; 29 | } 30 | -------------------------------------------------------------------------------- /primer/examples/scratch.cc: -------------------------------------------------------------------------------- 1 | #include "concepts.h" 2 | 3 | 4 | 5 | int main(int, char**) { 6 | return 0; 7 | } 8 | -------------------------------------------------------------------------------- /primer/examples/sfinae.cc: -------------------------------------------------------------------------------- 1 | #include "sfinae.hh" 2 | 3 | #include "concepts.h" 4 | 5 | #include 6 | 7 | template 8 | bool check(const T& x, const U& y) { 9 | return x == y; 10 | } 11 | 12 | template> 14 | bool check_sfinae(const T& x, const U& y) { 15 | return x == y; 16 | } 17 | 18 | template 19 | requires EqualityComparableWith 20 | bool check_concepts(const T& x, const U& y) { 21 | return x == y; 22 | } 23 | 24 | int main(int, char**) { 25 | 26 | check(4, 2); 27 | check(4.0, 2.0); 28 | check(4.0, 2); 29 | 30 | std::vector v2 { 2 }; 31 | 32 | #if false 33 | 34 | check(4, v2); 35 | 36 | #endif 37 | 38 | std::vector v4 { 4 }; 39 | 40 | #if false 41 | 42 | check_sfinae(2, v4); 43 | 44 | #endif 45 | 46 | #if false 47 | 48 | check_concepts(2, v4); 49 | 50 | #endif 51 | 52 | return 0; 53 | } 54 | -------------------------------------------------------------------------------- /primer/examples/sfinae.hh: -------------------------------------------------------------------------------- 1 | #ifndef SFINAE_HH 2 | #define SFINAE_HH 3 | 4 | #include 5 | 6 | template 7 | struct is_equality_comparable : std::false_type { }; 8 | 9 | template 10 | struct is_equality_comparable() == std::declval(), 13 | (void) 0)>::type> : std::true_type { }; 14 | 15 | template 16 | using is_equality_comparable_t = typename 17 | is_equality_comparable::type; 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /primer/examples/zero.cc: -------------------------------------------------------------------------------- 1 | #include "concepts.h" 2 | 3 | #include 4 | #include 5 | 6 | template 7 | requires Sortable 8 | void sort(Range& range); 9 | 10 | 11 | template 12 | requires RandomAccessIterator 13 | void sort(Iterator begin, Iterator end); 14 | 15 | template 16 | requires Mergeable 17 | Out merge(In1 f1, In1 l1, In2 f2, In2 l2, Out out); 18 | 19 | template 20 | requires Even 21 | auto square_even() { 22 | return N*N; 23 | } 24 | 25 | int main(int, char**) { 26 | 27 | #if true // Replace with 'false'! 28 | std::list l { 1, 2, 3, 4, 5 }; 29 | #else 30 | // Won't compile! ForwardIterator does 31 | // not satisfy BidirectionalIterator! 32 | std::forward_list l { 1, 2, 3, 4, 5 }; 33 | #endif 34 | 35 | #if false 36 | 37 | // No way to do this with verbose syntax! 38 | 39 | #endif 40 | 41 | return 0; 42 | } 43 | -------------------------------------------------------------------------------- /primer/figures/.gitattributes: -------------------------------------------------------------------------------- 1 | screenshots.png filter=lfs diff=lfs merge=lfs -text 2 | -------------------------------------------------------------------------------- /primer/figures/logical_operations.eps: -------------------------------------------------------------------------------- 1 | %!PS-Adobe-3.0 EPSF-3.0 2 | %%BoundingBox: 0 0 591 188 3 | %%Pages: 0 4 | %%Creator: LibreOffice 6.0 5 | %%Title: none 6 | %%CreationDate: none 7 | %%LanguageLevel: 2 8 | %%EndComments 9 | %%BeginProlog 10 | %%BeginResource: procset SDRes-Prolog 1.0 0 11 | /b4_inc_state save def 12 | /dict_count countdictstack def 13 | /op_count count 1 sub def 14 | userdict begin 15 | 0 setgray 0 setlinecap 1 setlinewidth 0 setlinejoin 10 setmiterlimit[] 0 setdash newpath 16 | /languagelevel where {pop languagelevel 1 ne {false setstrokeadjust false setoverprint} if} if 17 | /bdef {bind def} bind def 18 | /c {setrgbcolor} bdef 19 | /l {neg lineto} bdef 20 | /rl {neg rlineto} bdef 21 | /lc {setlinecap} bdef 22 | /lj {setlinejoin} bdef 23 | /lw {setlinewidth} bdef 24 | /ml {setmiterlimit} bdef 25 | /ld {setdash} bdef 26 | /m {neg moveto} bdef 27 | /ct {6 2 roll neg 6 2 roll neg 6 2 roll neg curveto} bdef 28 | /r {rotate} bdef 29 | /t {neg translate} bdef 30 | /s {scale} bdef 31 | /sw {show} bdef 32 | /gs {gsave} bdef 33 | /gr {grestore} bdef 34 | /f {findfont dup length dict begin 35 | {1 index /FID ne {def} {pop pop} ifelse} forall /Encoding ISOLatin1Encoding def 36 | currentdict end /NFont exch definefont pop /NFont findfont} bdef 37 | /p {closepath} bdef 38 | /sf {scalefont setfont} bdef 39 | /ef {eofill}bdef 40 | /pc {closepath stroke}bdef 41 | /ps {stroke}bdef 42 | /pum {matrix currentmatrix}bdef 43 | /pom {setmatrix}bdef 44 | /bs {/aString exch def /nXOfs exch def /nWidth exch def currentpoint nXOfs 0 rmoveto pum nWidth aString stringwidth pop div 1 scale aString show pom moveto} bdef 45 | %%EndResource 46 | %%EndProlog 47 | %%BeginSetup 48 | %%EndSetup 49 | %%Page: 1 1 50 | %%BeginPageSetup 51 | %%EndPageSetup 52 | pum 53 | 0.02832 0.02831 s 54 | 0 -6639 t 55 | /tm matrix currentmatrix def 56 | tm setmatrix 57 | -2252 -9869 t 58 | 1 1 s 59 | gs 60 | 1.000 1.000 1.000 c 17889 16489 m 12683 16489 l 12683 9887 l 23096 9887 l 61 | 23096 16489 l 17889 16489 l p ef 62 | gr 63 | gs 64 | 34.99305 lw 1 lj 1.000 1.000 1.000 c 17889 16489 m 12682 16489 l 12682 9887 l 65 | 23095 9887 l 23095 16489 l 17889 16489 l pc 66 | gr 67 | gs 68 | 0.867 0.867 0.867 c 15984 10014 m 16709 10014 17364 10237 17889 10621 ct 69 | 18414 10237 19069 10014 19794 10014 ct 21594 10014 22969 11389 22969 13188 ct 70 | 22969 14987 21594 16362 19794 16362 ct 19069 16362 18414 16139 17889 15755 ct 71 | 17364 16139 16709 16362 15984 16362 ct 14185 16362 12810 14987 12810 13188 ct 72 | 12810 11389 14185 10014 15984 10014 ct p ef 73 | gr 74 | gs 75 | 34.99305 lw 1 lj 0.003 0.003 0.003 c 15984 10013 m 16709 10013 17364 10236 17889 10620 ct 76 | 18414 10236 19069 10013 19794 10013 ct 21593 10013 22968 11388 22968 13188 ct 77 | 22968 14987 21593 16362 19794 16362 ct 19069 16362 18414 16139 17889 15755 ct 78 | 17364 16139 16709 16362 15984 16362 ct 14184 16362 12809 14987 12809 13188 ct 79 | 12809 11388 14184 10013 15984 10013 ct pc 80 | gr 81 | gs 82 | 0.800 0.800 0.800 c 19159 13216 m 19159 14291 18668 15214 17889 15783 ct 83 | 17110 15214 16619 14291 16619 13216 ct 16619 12141 17110 11218 17889 10649 ct 84 | 18668 11218 19159 12141 19159 13216 ct p ef 85 | gr 86 | gs 87 | 36 lw 1 lj 0.003 0.003 0.003 c 19159 13180 m 19159 13192 19159 13204 19159 13216 ct 88 | 19159 13239 19159 13263 19158 13286 ct ps 89 | 19156 13355 m 19155 13378 19154 13401 19153 13424 ct ps 90 | 19148 13492 m 19146 13515 19144 13538 19142 13561 ct ps 91 | 19134 13630 m 19132 13653 19129 13675 19125 13698 ct ps 92 | 19115 13766 m 19111 13789 19107 13811 19103 13833 ct ps 93 | 19090 13902 m 19085 13924 19080 13947 19075 13969 ct ps 94 | 19059 14036 m 19054 14058 19048 14081 19042 14103 ct ps 95 | 19023 14169 m 19016 14191 19009 14213 19002 14235 ct ps 96 | 18981 14300 m 18973 14322 18965 14344 18957 14365 ct ps 97 | 18933 14429 m 18924 14451 18916 14472 18907 14494 ct ps 98 | 18879 14557 m 18870 14578 18860 14599 18851 14620 ct ps 99 | 18821 14681 m 18810 14702 18800 14722 18789 14743 ct ps 100 | 18756 14803 m 18745 14824 18733 14844 18722 14863 ct ps 101 | 18686 14922 m 18674 14941 18662 14960 18649 14980 ct ps 102 | 18611 15037 m 18598 15056 18585 15075 18572 15094 ct ps 103 | 18531 15149 m 18517 15168 18503 15186 18489 15204 ct ps 104 | 18446 15258 m 18431 15275 18416 15293 18401 15310 ct ps 105 | 18356 15362 m 18340 15379 18325 15396 18309 15413 ct ps 106 | 18261 15462 m 18245 15479 18229 15495 18212 15511 ct ps 107 | 18162 15558 m 18145 15574 18128 15589 18111 15605 ct ps 108 | 18059 15650 m 18041 15665 18024 15679 18006 15694 ct ps 109 | 17951 15736 m 17933 15750 17915 15764 17896 15778 ct ps 110 | 17841 15747 m 17823 15733 17804 15719 17786 15705 ct ps 111 | 17733 15661 m 17715 15647 17698 15632 17681 15617 ct ps 112 | 17629 15571 m 17612 15555 17595 15539 17579 15523 ct ps 113 | 17530 15475 m 17513 15459 17497 15443 17481 15426 ct ps 114 | 17434 15375 m 17419 15359 17404 15341 17388 15324 ct ps 115 | 17344 15272 m 17329 15254 17315 15236 17300 15218 ct ps 116 | 17258 15164 m 17244 15145 17230 15127 17217 15108 ct ps 117 | 17177 15052 m 17164 15033 17151 15014 17139 14995 ct ps 118 | 17101 14937 m 17089 14918 17077 14899 17065 14879 ct ps 119 | 17031 14819 m 17020 14799 17008 14779 16998 14759 ct ps 120 | 16966 14697 m 16955 14677 16945 14656 16935 14636 ct ps 121 | 16906 14573 m 16897 14552 16887 14531 16878 14510 ct ps 122 | 16852 14446 m 16843 14425 16835 14404 16827 14382 ct ps 123 | 16803 14317 m 16796 14296 16788 14274 16781 14252 ct ps 124 | 16760 14186 m 16754 14164 16747 14142 16741 14120 ct ps 125 | 16723 14054 m 16718 14031 16712 14009 16707 13987 ct ps 126 | 16692 13919 m 16687 13897 16682 13874 16678 13851 ct ps 127 | 16666 13784 m 16662 13761 16659 13739 16655 13716 ct ps 128 | 16646 13648 m 16643 13625 16640 13602 16638 13579 ct ps 129 | 16631 13510 m 16629 13487 16628 13464 16626 13442 ct ps 130 | 16623 13373 m 16621 13350 16621 13327 16620 13304 ct ps 131 | 16619 13234 m 16619 13228 16619 13222 16619 13216 ct 16619 13199 16619 13182 16619 13164 ct 132 | ps 133 | 16621 13095 m 16622 13072 16623 13049 16624 13026 ct ps 134 | 16629 12958 m 16630 12935 16632 12912 16634 12890 ct ps 135 | 16642 12820 m 16644 12797 16647 12775 16650 12752 ct ps 136 | 16660 12684 m 16664 12661 16668 12638 16672 12616 ct ps 137 | 16684 12548 m 16689 12526 16694 12503 16699 12480 ct ps 138 | 16715 12413 m 16720 12391 16726 12369 16732 12347 ct ps 139 | 16750 12281 m 16757 12258 16763 12236 16770 12214 ct ps 140 | 16792 12149 m 16799 12127 16807 12105 16814 12084 ct ps 141 | 16838 12019 m 16847 11998 16855 11976 16864 11955 ct ps 142 | 16891 11892 m 16901 11870 16910 11850 16920 11829 ct ps 143 | 16949 11767 m 16960 11746 16970 11726 16981 11705 ct ps 144 | 17013 11644 m 17024 11624 17036 11605 17047 11585 ct ps 145 | 17082 11526 m 17094 11506 17106 11487 17119 11468 ct ps 146 | 17157 11410 m 17170 11391 17183 11372 17196 11353 ct ps 147 | 17236 11297 m 17250 11279 17264 11261 17278 11242 ct ps 148 | 17321 11188 m 17335 11170 17350 11153 17365 11135 ct ps 149 | 17410 11083 m 17426 11066 17441 11049 17457 11032 ct ps 150 | 17504 10982 m 17520 10966 17537 10950 17553 10934 ct ps 151 | 17603 10886 m 17620 10870 17636 10855 17654 10839 ct ps 152 | 17705 10794 m 17723 10779 17741 10764 17758 10750 ct ps 153 | 17812 10707 m 17830 10693 17849 10679 17867 10665 ct ps 154 | 17923 10674 m 17941 10688 17959 10702 17977 10716 ct ps 155 | 18031 10759 m 18049 10774 18066 10789 18084 10804 ct ps 156 | 18135 10849 m 18153 10865 18169 10880 18186 10896 ct ps 157 | 18236 10944 m 18252 10960 18268 10977 18284 10993 ct ps 158 | 18331 11043 m 18347 11060 18362 11077 18378 11094 ct ps 159 | 18423 11147 m 18437 11164 18452 11182 18467 11200 ct ps 160 | 18509 11254 m 18523 11272 18537 11291 18551 11309 ct ps 161 | 18591 11365 m 18604 11384 18617 11403 18630 11422 ct ps 162 | 18667 11480 m 18679 11500 18692 11519 18703 11539 ct ps 163 | 18738 11598 m 18750 11618 18761 11637 18772 11657 ct ps 164 | 18804 11719 m 18815 11739 18825 11759 18835 11780 ct ps 165 | 18865 11842 m 18874 11863 18883 11884 18893 11905 ct ps 166 | 18919 11969 m 18928 11990 18937 12012 18945 12033 ct ps 167 | 18969 12098 m 18976 12119 18984 12141 18991 12163 ct ps 168 | 19012 12229 m 19019 12251 19026 12273 19032 12295 ct ps 169 | 19050 12361 m 19056 12383 19062 12405 19067 12428 ct ps 170 | 19082 12495 m 19087 12518 19092 12540 19096 12563 ct ps 171 | 19109 12631 m 19113 12653 19117 12676 19120 12698 ct ps 172 | 19130 12767 m 19133 12789 19136 12812 19138 12835 ct ps 173 | 19145 12904 m 19147 12927 19149 12950 19151 12972 ct ps 174 | 19155 13041 m 19156 13064 19157 13087 19157 13110 ct ps 175 | gr 176 | pum 177 | 13476 13375 t 178 | 0.003 0.003 0.003 c 21 0 m 21 -30 l 93 -30 l 93 -406 l 21 -406 l 21 -436 l 179 | 38 -435 77 -434 138 -434 ct 199 -434 239 -435 256 -436 ct 256 -406 l 184 -406 l 180 | 184 -30 l 256 -30 l 256 0 l 239 -1 199 -2 138 -2 ct 77 -2 38 -1 21 0 ct p ef 181 | 304 -1 m 304 -30 l 347 -30 l 347 -227 l 347 -239 345 -246 341 -248 ct 182 | 336 -251 324 -252 304 -252 ct 304 -282 l 413 -287 l 413 -218 l 436 -264 473 -287 524 -287 ct 183 | 557 -287 581 -280 597 -266 ct 614 -251 622 -228 622 -195 ct 622 -30 l 666 -30 l 184 | 666 -1 l 630 -1 603 -1 586 -1 ct 568 -1 541 -1 506 -1 ct 506 -30 l 549 -30 l 185 | 549 -202 l 549 -225 546 -241 540 -250 ct 535 -259 526 -264 514 -264 ct 491 -264 470 -255 450 -238 ct 186 | 430 -220 420 -195 420 -163 ct 420 -30 l 464 -30 l 464 -1 l 428 -1 401 -1 384 -1 ct 187 | 366 -1 339 -1 304 -1 ct p ef 188 | 673 -252 m 673 -276 l 703 -276 726 -288 743 -314 ct 759 -339 768 -369 768 -404 ct 189 | 798 -404 l 798 -282 l 891 -282 l 891 -252 l 798 -252 l 798 -77 l 190 | 798 -40 810 -21 835 -21 ct 845 -21 854 -26 861 -36 ct 869 -45 873 -60 873 -80 ct 191 | 873 -112 l 903 -112 l 903 -79 l 903 -55 896 -35 882 -20 ct 868 -4 849 4 826 4 ct 192 | 759 4 725 -23 725 -78 ct 725 -252 l 673 -252 l p ef 193 | 964 -143 m 964 -184 978 -219 1006 -247 ct 1034 -274 1072 -288 1121 -288 ct 194 | 1165 -288 1198 -276 1222 -253 ct 1246 -230 1258 -197 1258 -155 ct 1258 -147 1256 -142 1254 -141 ct 195 | 1251 -139 1245 -138 1237 -138 ct 1046 -138 l 1046 -60 1076 -21 1136 -21 ct 196 | 1157 -21 1175 -26 1192 -35 ct 1208 -45 1220 -57 1227 -72 ct 1229 -78 1231 -81 1232 -83 ct 197 | 1234 -85 1237 -85 1242 -85 ct 1253 -85 1258 -82 1258 -74 ct 1258 -71 1257 -67 1254 -62 ct 198 | 1252 -56 1248 -50 1242 -42 ct 1235 -34 1228 -27 1219 -20 ct 1210 -13 1197 -8 1182 -3 ct 199 | 1166 2 1149 4 1130 4 ct 1080 4 1039 -10 1009 -37 ct 979 -64 964 -100 964 -143 ct 200 | p 201 | 1046 -159 m 1197 -159 l 1195 -230 1170 -265 1121 -265 ct 1095 -265 1075 -254 1061 -232 ct 202 | 1052 -219 1047 -194 1046 -159 ct p ef 203 | 1298 48 m 1298 39 1301 30 1305 23 ct 1310 15 1316 10 1323 6 ct 1330 1 1336 -1 1341 -3 ct 204 | 1345 -5 1349 -7 1353 -8 ct 1334 -22 1325 -43 1325 -69 ct 1325 -88 1332 -107 1347 -125 ct 205 | 1336 -133 1328 -142 1322 -154 ct 1317 -166 1314 -179 1314 -192 ct 1314 -217 1324 -239 1345 -258 ct 206 | 1366 -277 1398 -286 1440 -286 ct 1476 -286 1504 -279 1525 -265 ct 1545 -281 1568 -289 1592 -289 ct 207 | 1605 -289 1615 -285 1622 -277 ct 1629 -269 1632 -261 1632 -252 ct 1632 -245 1630 -238 1625 -233 ct 208 | 1620 -227 1613 -225 1605 -225 ct 1597 -225 1590 -227 1585 -232 ct 1580 -238 1578 -244 1578 -252 ct 209 | 1578 -256 1579 -261 1580 -265 ct 1567 -264 1554 -260 1541 -253 ct 1558 -235 1566 -214 1566 -192 ct 210 | 1566 -167 1556 -145 1535 -126 ct 1514 -107 1482 -98 1440 -98 ct 1409 -98 1384 -104 1362 -115 ct 211 | 1358 -109 1356 -102 1356 -93 ct 1356 -85 1359 -76 1364 -68 ct 1370 -59 1379 -54 1391 -52 ct 212 | 1393 -52 1409 -52 1440 -52 ct 1465 -52 1484 -52 1496 -52 ct 1508 -52 1521 -51 1535 -48 ct 213 | 1550 -45 1563 -41 1575 -35 ct 1606 -19 1622 8 1622 46 ct 1622 69 1609 89 1581 105 ct 214 | 1554 120 1514 128 1460 128 ct 1403 128 1362 120 1336 103 ct 1311 87 1298 68 1298 48 ct 215 | p 216 | 1353 47 m 1353 63 1362 76 1380 88 ct 1398 99 1425 105 1460 105 ct 1498 105 1525 99 1542 87 ct 217 | 1559 75 1568 62 1568 48 ct 1568 22 1537 8 1476 8 ct 1402 8 l 1369 8 1353 21 1353 47 ct 218 | p 219 | 1384 -211 m 1384 -206 1384 -200 1384 -192 ct 1384 -184 1384 -178 1384 -173 ct 220 | 1385 -169 1386 -163 1388 -155 ct 1389 -148 1392 -142 1396 -137 ct 1400 -133 1406 -129 1413 -126 ct 221 | 1420 -123 1429 -121 1440 -121 ct 1451 -121 1460 -123 1467 -126 ct 1474 -129 1480 -133 1484 -137 ct 222 | 1488 -142 1490 -148 1492 -155 ct 1494 -163 1495 -169 1495 -173 ct 1496 -178 1496 -184 1496 -192 ct 223 | 1496 -200 1496 -206 1495 -211 ct 1495 -215 1494 -221 1492 -229 ct 1490 -236 1488 -242 1484 -247 ct 224 | 1480 -251 1474 -255 1467 -258 ct 1460 -261 1451 -263 1440 -263 ct 1429 -263 1420 -261 1413 -258 ct 225 | 1406 -255 1400 -251 1396 -247 ct 1392 -242 1389 -236 1388 -229 ct 1386 -221 1385 -215 1384 -211 ct 226 | p ef 227 | 1667 -1 m 1667 -30 l 1710 -30 l 1710 -227 l 1710 -239 1708 -246 1704 -248 ct 228 | 1699 -251 1687 -252 1667 -252 ct 1667 -282 l 1772 -287 l 1772 -215 l 1789 -263 1817 -287 1856 -287 ct 229 | 1874 -287 1890 -282 1903 -273 ct 1917 -264 1924 -251 1924 -235 ct 1924 -223 1920 -213 1912 -206 ct 230 | 1904 -199 1895 -196 1885 -196 ct 1875 -196 1866 -199 1858 -206 ct 1850 -213 1846 -222 1846 -235 ct 231 | 1846 -246 1850 -256 1858 -264 ct 1843 -264 1831 -260 1820 -252 ct 1809 -243 1800 -232 1795 -219 ct 232 | 1789 -206 1785 -193 1783 -180 ct 1780 -167 1779 -154 1779 -142 ct 1779 -30 l 233 | 1834 -30 l 1834 0 l 1819 -1 1790 -1 1747 -1 ct 1738 -1 1711 -1 1667 -1 ct 234 | p ef 235 | 1963 -69 m 1963 -129 2032 -162 2170 -168 ct 2170 -190 l 2170 -240 2146 -265 2100 -265 ct 236 | 2083 -265 2068 -264 2054 -261 ct 2063 -254 2068 -244 2068 -229 ct 2068 -217 2064 -207 2056 -200 ct 237 | 2048 -193 2039 -189 2028 -189 ct 2018 -189 2009 -193 2001 -200 ct 1993 -207 1989 -217 1989 -229 ct 238 | 1989 -268 2027 -288 2102 -288 ct 2148 -288 2183 -279 2207 -261 ct 2230 -243 2242 -220 2242 -190 ct 239 | 2242 -53 l 2242 -47 2243 -43 2243 -41 ct 2244 -38 2248 -36 2254 -33 ct 2259 -31 2269 -30 2281 -30 ct 240 | 2285 -30 2287 -30 2289 -29 ct 2291 -29 2293 -28 2294 -25 ct 2296 -23 2297 -20 2297 -15 ct 241 | 2297 -8 2296 -4 2293 -3 ct 2290 -1 2285 0 2277 0 ct 2247 0 l 2231 0 2218 -1 2208 -4 ct 242 | 2199 -7 2192 -12 2188 -18 ct 2185 -24 2183 -29 2182 -33 ct 2181 -37 2180 -42 2180 -49 ct 243 | 2162 -14 2131 4 2086 4 ct 2073 4 2060 3 2048 1 ct 2035 -1 2022 -4 2008 -9 ct 1995 -14 1984 -21 1976 -32 ct 244 | 1967 -42 1963 -54 1963 -69 ct p 245 | 2038 -69 m 2038 -55 2043 -43 2054 -34 ct 2066 -24 2079 -19 2095 -19 ct 2101 -19 2107 -20 2114 -21 ct 246 | 2121 -23 2129 -26 2138 -30 ct 2147 -35 2155 -42 2161 -52 ct 2167 -62 2170 -74 2170 -88 ct 247 | 2170 -148 l 2160 -148 2152 -148 2143 -146 ct 2135 -145 2124 -143 2110 -139 ct 248 | 2096 -136 2084 -132 2074 -126 ct 2065 -121 2056 -114 2049 -104 ct 2041 -94 2038 -82 2038 -69 ct 249 | p ef 250 | 2329 -1 m 2329 -30 l 2373 -30 l 2373 -382 l 2373 -394 2370 -401 2366 -403 ct 251 | 2362 -405 2349 -407 2329 -407 ct 2329 -436 l 2441 -441 l 2441 -30 l 2485 -30 l 252 | 2485 -1 l 2442 -1 2416 -1 2407 -1 ct 2396 -1 2369 -1 2329 -1 ct p ef 253 | pom 254 | pum 255 | 19699 13375 t 256 | 25 0 m 25 -30 l 93 -30 l 93 -403 l 25 -403 l 25 -433 l 409 -433 l 257 | 429 -279 l 399 -279 l 397 -296 394 -310 392 -321 ct 389 -332 385 -343 380 -355 ct 258 | 374 -366 367 -375 358 -381 ct 350 -388 338 -393 324 -397 ct 309 -401 292 -403 272 -403 ct 259 | 184 -403 l 184 -232 l 215 -232 l 244 -232 262 -238 270 -249 ct 278 -260 282 -279 282 -306 ct 260 | 312 -306 l 312 -127 l 282 -127 l 282 -154 278 -173 270 -185 ct 262 -196 244 -202 215 -202 ct 261 | 184 -202 l 184 -30 l 269 -30 l 269 -1 l 251 -1 208 -1 141 -1 ct 80 -1 41 -1 25 0 ct 262 | p ef 263 | 487 -1 m 487 -30 l 531 -30 l 531 -382 l 531 -394 528 -401 524 -403 ct 264 | 520 -405 507 -407 487 -407 ct 487 -436 l 599 -441 l 599 -30 l 643 -30 l 265 | 643 -1 l 600 -1 574 -1 565 -1 ct 554 -1 527 -1 487 -1 ct p ef 266 | 680 -138 m 680 -182 695 -218 723 -246 ct 752 -274 791 -288 842 -288 ct 893 -288 932 -274 961 -246 ct 267 | 990 -218 1004 -182 1004 -138 ct 1004 -97 990 -63 962 -36 ct 933 -9 893 4 842 4 ct 268 | 791 4 751 -9 723 -36 ct 695 -63 680 -97 680 -138 ct p 269 | 762 -145 m 762 -133 762 -123 762 -117 ct 762 -110 763 -101 764 -89 ct 766 -78 768 -68 772 -62 ct 270 | 775 -56 780 -49 785 -42 ct 791 -35 799 -29 808 -26 ct 818 -23 829 -21 842 -21 ct 271 | 855 -21 867 -23 876 -26 ct 886 -29 893 -35 899 -42 ct 905 -49 909 -56 913 -62 ct 272 | 916 -68 919 -78 920 -89 ct 922 -101 922 -110 923 -117 ct 923 -123 923 -133 923 -145 ct 273 | 923 -189 918 -218 910 -233 ct 896 -254 874 -265 842 -265 ct 808 -265 785 -253 772 -228 ct 274 | 765 -214 762 -186 762 -145 ct p ef 275 | 1044 -69 m 1044 -129 1113 -162 1251 -168 ct 1251 -190 l 1251 -240 1227 -265 1181 -265 ct 276 | 1164 -265 1149 -264 1135 -261 ct 1144 -254 1149 -244 1149 -229 ct 1149 -217 1145 -207 1137 -200 ct 277 | 1129 -193 1120 -189 1109 -189 ct 1099 -189 1090 -193 1082 -200 ct 1074 -207 1070 -217 1070 -229 ct 278 | 1070 -268 1108 -288 1183 -288 ct 1229 -288 1264 -279 1288 -261 ct 1311 -243 1323 -220 1323 -190 ct 279 | 1323 -53 l 1323 -47 1324 -43 1324 -41 ct 1325 -38 1329 -36 1335 -33 ct 1340 -31 1350 -30 1362 -30 ct 280 | 1366 -30 1368 -30 1370 -29 ct 1372 -29 1374 -28 1375 -25 ct 1377 -23 1378 -20 1378 -15 ct 281 | 1378 -8 1377 -4 1374 -3 ct 1371 -1 1366 0 1358 0 ct 1328 0 l 1312 0 1299 -1 1289 -4 ct 282 | 1280 -7 1273 -12 1269 -18 ct 1266 -24 1264 -29 1263 -33 ct 1262 -37 1261 -42 1261 -49 ct 283 | 1243 -14 1212 4 1167 4 ct 1154 4 1141 3 1129 1 ct 1116 -1 1103 -4 1089 -9 ct 1076 -14 1065 -21 1057 -32 ct 284 | 1048 -42 1044 -54 1044 -69 ct p 285 | 1119 -69 m 1119 -55 1124 -43 1135 -34 ct 1147 -24 1160 -19 1176 -19 ct 1182 -19 1188 -20 1195 -21 ct 286 | 1202 -23 1210 -26 1219 -30 ct 1228 -35 1236 -42 1242 -52 ct 1248 -62 1251 -74 1251 -88 ct 287 | 1251 -148 l 1241 -148 1233 -148 1224 -146 ct 1216 -145 1205 -143 1191 -139 ct 288 | 1177 -136 1165 -132 1155 -126 ct 1146 -121 1137 -114 1130 -104 ct 1122 -94 1119 -82 1119 -69 ct 289 | p ef 290 | 1393 -252 m 1393 -276 l 1423 -276 1446 -288 1463 -314 ct 1479 -339 1488 -369 1488 -404 ct 291 | 1518 -404 l 1518 -282 l 1611 -282 l 1611 -252 l 1518 -252 l 1518 -77 l 292 | 1518 -40 1530 -21 1555 -21 ct 1565 -21 1574 -26 1581 -36 ct 1589 -45 1593 -60 1593 -80 ct 293 | 1593 -112 l 1623 -112 l 1623 -79 l 1623 -55 1616 -35 1602 -20 ct 1588 -4 1569 4 1546 4 ct 294 | 1479 4 1445 -23 1445 -78 ct 1445 -252 l 1393 -252 l p ef 295 | 1728 -357 m 1718 -367 1714 -378 1714 -392 ct 1714 -405 1718 -417 1728 -427 ct 296 | 1737 -437 1749 -442 1763 -442 ct 1777 -442 1788 -437 1798 -427 ct 1808 -417 1813 -405 1813 -392 ct 297 | 1813 -378 1808 -367 1798 -357 ct 1788 -347 1777 -342 1763 -342 ct 1749 -342 1737 -347 1728 -357 ct 298 | p 299 | 1694 0 m 1694 -29 l 1738 -29 l 1738 -226 l 1738 -238 1736 -245 1731 -247 ct 300 | 1727 -250 1715 -251 1696 -251 ct 1696 -281 l 1806 -286 l 1806 -29 l 1846 -29 l 301 | 1846 0 l 1800 0 1775 0 1771 0 ct 1759 0 1733 0 1694 0 ct p ef 302 | 1896 -1 m 1896 -30 l 1939 -30 l 1939 -227 l 1939 -239 1937 -246 1933 -248 ct 303 | 1928 -251 1916 -252 1896 -252 ct 1896 -282 l 2005 -287 l 2005 -218 l 2028 -264 2065 -287 2116 -287 ct 304 | 2149 -287 2173 -280 2189 -266 ct 2206 -251 2214 -228 2214 -195 ct 2214 -30 l 305 | 2258 -30 l 2258 -1 l 2222 -1 2195 -1 2178 -1 ct 2160 -1 2133 -1 2098 -1 ct 306 | 2098 -30 l 2141 -30 l 2141 -202 l 2141 -225 2138 -241 2132 -250 ct 2127 -259 2118 -264 2106 -264 ct 307 | 2083 -264 2062 -255 2042 -238 ct 2022 -220 2012 -195 2012 -163 ct 2012 -30 l 308 | 2056 -30 l 2056 -1 l 2020 -1 1993 -1 1976 -1 ct 1958 -1 1931 -1 1896 -1 ct 309 | p ef 310 | 2293 48 m 2293 39 2296 30 2300 23 ct 2305 15 2311 10 2318 6 ct 2325 1 2331 -1 2336 -3 ct 311 | 2340 -5 2344 -7 2348 -8 ct 2329 -22 2320 -43 2320 -69 ct 2320 -88 2327 -107 2342 -125 ct 312 | 2331 -133 2323 -142 2317 -154 ct 2312 -166 2309 -179 2309 -192 ct 2309 -217 2319 -239 2340 -258 ct 313 | 2361 -277 2393 -286 2435 -286 ct 2471 -286 2499 -279 2520 -265 ct 2540 -281 2563 -289 2587 -289 ct 314 | 2600 -289 2610 -285 2617 -277 ct 2624 -269 2627 -261 2627 -252 ct 2627 -245 2625 -238 2620 -233 ct 315 | 2615 -227 2608 -225 2600 -225 ct 2592 -225 2585 -227 2580 -232 ct 2575 -238 2573 -244 2573 -252 ct 316 | 2573 -256 2574 -261 2575 -265 ct 2562 -264 2549 -260 2536 -253 ct 2553 -235 2561 -214 2561 -192 ct 317 | 2561 -167 2551 -145 2530 -126 ct 2509 -107 2477 -98 2435 -98 ct 2404 -98 2379 -104 2357 -115 ct 318 | 2353 -109 2351 -102 2351 -93 ct 2351 -85 2354 -76 2359 -68 ct 2365 -59 2374 -54 2386 -52 ct 319 | 2388 -52 2404 -52 2435 -52 ct 2460 -52 2479 -52 2491 -52 ct 2503 -52 2516 -51 2530 -48 ct 320 | 2545 -45 2558 -41 2570 -35 ct 2601 -19 2617 8 2617 46 ct 2617 69 2604 89 2576 105 ct 321 | 2549 120 2509 128 2455 128 ct 2398 128 2357 120 2331 103 ct 2306 87 2293 68 2293 48 ct 322 | p 323 | 2348 47 m 2348 63 2357 76 2375 88 ct 2393 99 2420 105 2455 105 ct 2493 105 2520 99 2537 87 ct 324 | 2554 75 2563 62 2563 48 ct 2563 22 2532 8 2471 8 ct 2397 8 l 2364 8 2348 21 2348 47 ct 325 | p 326 | 2379 -211 m 2379 -206 2379 -200 2379 -192 ct 2379 -184 2379 -178 2379 -173 ct 327 | 2380 -169 2381 -163 2383 -155 ct 2384 -148 2387 -142 2391 -137 ct 2395 -133 2401 -129 2408 -126 ct 328 | 2415 -123 2424 -121 2435 -121 ct 2446 -121 2455 -123 2462 -126 ct 2469 -129 2475 -133 2479 -137 ct 329 | 2483 -142 2485 -148 2487 -155 ct 2489 -163 2490 -169 2490 -173 ct 2491 -178 2491 -184 2491 -192 ct 330 | 2491 -200 2491 -206 2490 -211 ct 2490 -215 2489 -221 2487 -229 ct 2485 -236 2483 -242 2479 -247 ct 331 | 2475 -251 2469 -255 2462 -258 ct 2455 -261 2446 -263 2435 -263 ct 2424 -263 2415 -261 2408 -258 ct 332 | 2401 -255 2395 -251 2391 -247 ct 2387 -242 2384 -236 2383 -229 ct 2381 -221 2380 -215 2379 -211 ct 333 | p ef 334 | pom 335 | gs 336 | 1.000 1.000 1.000 c 7476 16489 m 2270 16489 l 2270 9887 l 12683 9887 l 337 | 12683 16489 l 7476 16489 l p ef 338 | gr 339 | gs 340 | 34.99305 lw 1 lj 1.000 1.000 1.000 c 7476 16489 m 2269 16489 l 2269 9887 l 341 | 12682 9887 l 12682 16489 l 7476 16489 l pc 342 | gr 343 | gs 344 | 1.000 1.000 1.000 c 5571 10014 m 6296 10014 6951 10237 7476 10621 ct 8001 10237 8656 10014 9381 10014 ct 345 | 11181 10014 12556 11389 12556 13188 ct 12556 14987 11181 16362 9381 16362 ct 346 | 8656 16362 8001 16139 7476 15755 ct 6951 16139 6296 16362 5571 16362 ct 3772 16362 2397 14987 2397 13188 ct 347 | 2397 11389 3772 10014 5571 10014 ct p ef 348 | gr 349 | gs 350 | 34.99305 lw 1 lj 5571 10013 m 6296 10013 6951 10236 7476 10620 ct 8001 10236 8656 10013 9381 10013 ct 351 | 11180 10013 12555 11388 12555 13188 ct 12555 14987 11180 16362 9381 16362 ct 352 | 8656 16362 8001 16139 7476 15755 ct 6951 16139 6296 16362 5571 16362 ct 3771 16362 2396 14987 2396 13188 ct 353 | 2396 11388 3771 10013 5571 10013 ct pc 354 | gr 355 | gs 356 | 0.800 0.800 0.800 c 8746 13216 m 8746 14291 8255 15214 7476 15783 ct 6697 15214 6206 14291 6206 13216 ct 357 | 6206 12141 6697 11218 7476 10649 ct 8255 11218 8746 12141 8746 13216 ct p ef 358 | gr 359 | gs 360 | 36 lw 1 lj 8746 13180 m 8746 13192 8746 13204 8746 13216 ct 8746 13239 8746 13263 8745 13286 ct 361 | ps 362 | 8743 13355 m 8742 13378 8741 13401 8740 13424 ct ps 363 | 8735 13492 m 8733 13515 8731 13538 8729 13561 ct ps 364 | 8721 13630 m 8719 13653 8716 13675 8712 13698 ct ps 365 | 8702 13766 m 8698 13789 8694 13811 8690 13833 ct ps 366 | 8677 13902 m 8672 13924 8667 13947 8662 13969 ct ps 367 | 8646 14036 m 8641 14058 8635 14081 8629 14103 ct ps 368 | 8610 14169 m 8603 14191 8596 14213 8589 14235 ct ps 369 | 8568 14300 m 8560 14322 8552 14344 8544 14365 ct ps 370 | 8520 14429 m 8511 14451 8503 14472 8494 14494 ct ps 371 | 8466 14557 m 8457 14578 8447 14599 8438 14620 ct ps 372 | 8408 14681 m 8397 14702 8387 14722 8376 14743 ct ps 373 | 8343 14803 m 8332 14824 8320 14844 8309 14863 ct ps 374 | 8273 14922 m 8261 14941 8249 14960 8236 14980 ct ps 375 | 8198 15037 m 8185 15056 8172 15075 8159 15094 ct ps 376 | 8118 15149 m 8104 15168 8090 15186 8076 15204 ct ps 377 | 8033 15258 m 8018 15275 8003 15293 7988 15310 ct ps 378 | 7943 15362 m 7927 15379 7912 15396 7896 15413 ct ps 379 | 7848 15462 m 7832 15479 7816 15495 7799 15511 ct ps 380 | 7749 15558 m 7732 15574 7715 15589 7698 15605 ct ps 381 | 7646 15650 m 7628 15665 7611 15679 7593 15694 ct ps 382 | 7538 15736 m 7520 15750 7502 15764 7483 15778 ct ps 383 | 7428 15747 m 7410 15733 7391 15719 7373 15705 ct ps 384 | 7320 15661 m 7302 15647 7285 15632 7268 15617 ct ps 385 | 7216 15571 m 7199 15555 7182 15539 7166 15523 ct ps 386 | 7117 15475 m 7100 15459 7084 15443 7068 15426 ct ps 387 | 7021 15375 m 7006 15359 6991 15341 6975 15324 ct ps 388 | 6931 15272 m 6916 15254 6902 15236 6887 15218 ct ps 389 | 6845 15164 m 6831 15145 6817 15127 6804 15108 ct ps 390 | 6764 15052 m 6751 15033 6738 15014 6726 14995 ct ps 391 | 6688 14937 m 6676 14918 6664 14899 6652 14879 ct ps 392 | 6618 14819 m 6607 14799 6595 14779 6585 14759 ct ps 393 | 6553 14697 m 6542 14677 6532 14656 6522 14636 ct ps 394 | 6493 14573 m 6484 14552 6474 14531 6465 14510 ct ps 395 | 6439 14446 m 6430 14425 6422 14404 6414 14382 ct ps 396 | 6390 14317 m 6383 14296 6375 14274 6368 14252 ct ps 397 | 6347 14186 m 6341 14164 6334 14142 6328 14120 ct ps 398 | 6310 14054 m 6305 14031 6299 14009 6294 13987 ct ps 399 | 6279 13919 m 6274 13897 6269 13874 6265 13851 ct ps 400 | 6253 13784 m 6249 13761 6246 13739 6242 13716 ct ps 401 | 6233 13648 m 6230 13625 6227 13602 6225 13579 ct ps 402 | 6218 13510 m 6216 13487 6215 13464 6213 13442 ct ps 403 | 6210 13373 m 6208 13350 6208 13327 6207 13304 ct ps 404 | 6206 13234 m 6206 13228 6206 13222 6206 13216 ct 6206 13199 6206 13182 6206 13164 ct 405 | ps 406 | 6208 13095 m 6209 13072 6210 13049 6211 13026 ct ps 407 | 6216 12958 m 6217 12935 6219 12912 6221 12890 ct ps 408 | 6229 12820 m 6231 12797 6234 12775 6237 12752 ct ps 409 | 6247 12684 m 6251 12661 6255 12638 6259 12616 ct ps 410 | 6271 12548 m 6276 12526 6281 12503 6286 12480 ct ps 411 | 6302 12413 m 6307 12391 6313 12369 6319 12347 ct ps 412 | 6337 12281 m 6344 12258 6350 12236 6357 12214 ct ps 413 | 6379 12149 m 6386 12127 6394 12105 6401 12084 ct ps 414 | 6425 12019 m 6434 11998 6442 11976 6451 11955 ct ps 415 | 6478 11892 m 6488 11870 6497 11850 6507 11829 ct ps 416 | 6536 11767 m 6547 11746 6557 11726 6568 11705 ct ps 417 | 6600 11644 m 6611 11624 6623 11605 6634 11585 ct ps 418 | 6669 11526 m 6681 11506 6693 11487 6706 11468 ct ps 419 | 6744 11410 m 6757 11391 6770 11372 6783 11353 ct ps 420 | 6823 11297 m 6837 11279 6851 11261 6865 11242 ct ps 421 | 6908 11188 m 6922 11170 6937 11153 6952 11135 ct ps 422 | 6997 11083 m 7013 11066 7028 11049 7044 11032 ct ps 423 | 7091 10982 m 7107 10966 7124 10950 7140 10934 ct ps 424 | 7190 10886 m 7207 10870 7223 10855 7241 10839 ct ps 425 | 7292 10794 m 7310 10779 7328 10764 7345 10750 ct ps 426 | 7399 10707 m 7417 10693 7436 10679 7454 10665 ct ps 427 | 7510 10674 m 7528 10688 7546 10702 7564 10716 ct ps 428 | 7618 10759 m 7636 10774 7653 10789 7671 10804 ct ps 429 | 7722 10849 m 7740 10865 7756 10880 7773 10896 ct ps 430 | 7823 10944 m 7839 10960 7855 10977 7871 10993 ct ps 431 | 7918 11043 m 7934 11060 7949 11077 7965 11094 ct ps 432 | 8010 11147 m 8024 11164 8039 11182 8054 11200 ct ps 433 | 8096 11254 m 8110 11272 8124 11291 8138 11309 ct ps 434 | 8178 11365 m 8191 11384 8204 11403 8217 11422 ct ps 435 | 8254 11480 m 8266 11500 8279 11519 8290 11539 ct ps 436 | 8325 11598 m 8337 11618 8348 11637 8359 11657 ct ps 437 | 8391 11719 m 8402 11739 8412 11759 8422 11780 ct ps 438 | 8452 11842 m 8461 11863 8470 11884 8480 11905 ct ps 439 | 8506 11969 m 8515 11990 8524 12012 8532 12033 ct ps 440 | 8556 12098 m 8563 12119 8571 12141 8578 12163 ct ps 441 | 8599 12229 m 8606 12251 8613 12273 8619 12295 ct ps 442 | 8637 12361 m 8643 12383 8649 12405 8654 12428 ct ps 443 | 8669 12495 m 8674 12518 8679 12540 8683 12563 ct ps 444 | 8696 12631 m 8700 12653 8704 12676 8707 12698 ct ps 445 | 8717 12767 m 8720 12789 8723 12812 8725 12835 ct ps 446 | 8732 12904 m 8734 12927 8736 12950 8738 12972 ct ps 447 | 8742 13041 m 8743 13064 8744 13087 8744 13110 ct ps 448 | gr 449 | pum 450 | 3483 13375 t 451 | 25 0 m 25 -30 l 93 -30 l 93 -402 l 25 -402 l 25 -432 l 419 -432 l 452 | 439 -279 l 409 -279 l 407 -297 404 -311 402 -322 ct 399 -333 395 -344 389 -355 ct 453 | 383 -366 375 -375 366 -381 ct 358 -388 346 -393 331 -397 ct 317 -401 300 -402 280 -402 ct 454 | 184 -402 l 184 -239 l 218 -239 l 247 -239 265 -245 273 -256 ct 282 -268 286 -287 286 -314 ct 455 | 316 -314 l 316 -135 l 286 -135 l 286 -162 282 -181 273 -192 ct 265 -203 247 -209 218 -209 ct 456 | 184 -209 l 184 -30 l 280 -30 l 299 -30 316 -31 331 -34 ct 345 -37 358 -41 368 -48 ct 457 | 378 -55 386 -62 393 -69 ct 400 -76 406 -86 411 -98 ct 416 -110 419 -122 422 -133 ct 458 | 424 -144 427 -158 429 -174 ct 459 -174 l 430 0 l 25 0 l p ef 459 | 495 -252 m 495 -281 l 499 -281 510 -281 529 -281 ct 547 -281 560 -281 567 -281 ct 460 | 598 -281 624 -281 646 -281 ct 646 -252 l 611 -252 l 692 -79 l 766 -237 l 461 | 768 -242 769 -244 769 -245 ct 769 -250 759 -252 738 -252 ct 738 -281 l 765 -281 784 -281 796 -281 ct 462 | 814 -281 830 -281 846 -282 ct 846 -252 l 828 -252 816 -251 810 -249 ct 805 -247 801 -244 799 -239 ct 463 | 694 -12 l 689 -2 681 3 670 3 ct 659 3 651 -2 646 -13 ct 535 -252 l 495 -252 l 464 | p ef 465 | 862 -143 m 862 -184 876 -219 904 -247 ct 932 -274 970 -288 1019 -288 ct 1063 -288 1096 -276 1120 -253 ct 466 | 1144 -230 1156 -197 1156 -155 ct 1156 -147 1154 -142 1152 -141 ct 1149 -139 1143 -138 1135 -138 ct 467 | 944 -138 l 944 -60 974 -21 1034 -21 ct 1055 -21 1073 -26 1090 -35 ct 1106 -45 1118 -57 1125 -72 ct 468 | 1127 -78 1129 -81 1130 -83 ct 1132 -85 1135 -85 1140 -85 ct 1151 -85 1156 -82 1156 -74 ct 469 | 1156 -71 1155 -67 1152 -62 ct 1150 -56 1146 -50 1140 -42 ct 1133 -34 1126 -27 1117 -20 ct 470 | 1108 -13 1095 -8 1080 -3 ct 1064 2 1047 4 1028 4 ct 978 4 937 -10 907 -37 ct 877 -64 862 -100 862 -143 ct 471 | p 472 | 944 -159 m 1095 -159 l 1093 -230 1068 -265 1019 -265 ct 993 -265 973 -254 959 -232 ct 473 | 950 -219 945 -194 944 -159 ct p ef 474 | 1206 -1 m 1206 -30 l 1249 -30 l 1249 -227 l 1249 -239 1247 -246 1243 -248 ct 475 | 1238 -251 1226 -252 1206 -252 ct 1206 -282 l 1315 -287 l 1315 -218 l 1338 -264 1375 -287 1426 -287 ct 476 | 1459 -287 1483 -280 1499 -266 ct 1516 -251 1524 -228 1524 -195 ct 1524 -30 l 477 | 1568 -30 l 1568 -1 l 1532 -1 1505 -1 1488 -1 ct 1470 -1 1443 -1 1408 -1 ct 478 | 1408 -30 l 1451 -30 l 1451 -202 l 1451 -225 1448 -241 1442 -250 ct 1437 -259 1428 -264 1416 -264 ct 479 | 1393 -264 1372 -255 1352 -238 ct 1332 -220 1322 -195 1322 -163 ct 1322 -30 l 480 | 1366 -30 l 1366 -1 l 1330 -1 1303 -1 1286 -1 ct 1268 -1 1241 -1 1206 -1 ct 481 | p ef 482 | pom 483 | pum 484 | 9286 13375 t 485 | 25 0 m 25 -30 l 41 -30 l 53 -30 65 -31 75 -32 ct 84 -33 89 -34 91 -35 ct 486 | 93 -37 93 -41 93 -48 ct 93 -406 l 25 -406 l 25 -436 l 170 -436 l 177 -436 181 -436 183 -435 ct 487 | 185 -434 188 -432 191 -428 ct 444 -130 l 444 -388 l 444 -395 443 -399 441 -401 ct 488 | 440 -402 434 -404 425 -404 ct 413 -406 402 -406 391 -406 ct 375 -406 l 375 -436 l 489 | 393 -435 421 -434 461 -434 ct 502 -434 530 -435 546 -436 ct 546 -406 l 530 -406 l 490 | 518 -406 506 -406 496 -404 ct 487 -404 482 -402 480 -401 ct 478 -399 478 -395 478 -388 ct 491 | 478 -20 l 478 -12 477 -6 475 -4 ct 473 -1 468 0 460 0 ct 455 0 452 0 451 -1 ct 492 | 449 -2 447 -4 443 -8 ct 127 -381 l 127 -48 l 127 -41 128 -37 130 -35 ct 131 -34 137 -33 146 -32 ct 493 | 157 -31 169 -30 180 -30 ct 196 -30 l 196 0 l 178 -1 150 -2 110 -2 ct 69 -2 41 -1 25 0 ct 494 | p ef 495 | 601 -251 m 601 -281 l 717 -286 l 717 -69 l 717 -50 720 -36 725 -29 ct 496 | 731 -22 745 -19 768 -19 ct 791 -19 810 -27 824 -42 ct 839 -58 846 -79 846 -105 ct 497 | 846 -226 l 846 -238 844 -245 840 -248 ct 835 -250 823 -251 803 -251 ct 803 -281 l 498 | 919 -286 l 919 -54 l 919 -42 921 -35 925 -33 ct 930 -31 942 -30 963 -30 ct 499 | 963 0 l 850 4 l 850 -45 l 831 -12 800 4 759 4 ct 723 4 695 -2 675 -13 ct 500 | 654 -25 644 -47 644 -78 ct 644 -226 l 644 -238 642 -245 638 -248 ct 633 -250 621 -251 601 -251 ct 501 | p ef 502 | 1007 -1 m 1007 -30 l 1050 -30 l 1050 -227 l 1050 -239 1048 -246 1044 -248 ct 503 | 1039 -251 1027 -252 1007 -252 ct 1007 -282 l 1116 -287 l 1116 -218 l 1139 -264 1176 -287 1228 -287 ct 504 | 1282 -287 1314 -267 1323 -226 ct 1346 -267 1381 -287 1430 -287 ct 1464 -287 1488 -280 1504 -265 ct 505 | 1520 -251 1528 -227 1528 -195 ct 1528 -30 l 1572 -30 l 1572 -1 l 1536 -1 1510 -1 1492 -1 ct 506 | 1474 -1 1447 -1 1412 -1 ct 1412 -30 l 1456 -30 l 1456 -202 l 1456 -226 1453 -242 1447 -251 ct 507 | 1441 -260 1432 -264 1420 -264 ct 1397 -264 1376 -255 1356 -238 ct 1335 -220 1325 -195 1325 -163 ct 508 | 1325 -30 l 1369 -30 l 1369 -1 l 1334 -1 1307 -1 1289 -1 ct 1271 -1 1245 -1 1209 -1 ct 509 | 1209 -30 l 1253 -30 l 1253 -202 l 1253 -226 1250 -242 1244 -251 ct 1238 -260 1229 -264 1217 -264 ct 510 | 1195 -264 1173 -255 1153 -238 ct 1133 -220 1123 -195 1123 -163 ct 1123 -30 l 511 | 1167 -30 l 1167 -1 l 1131 -1 1104 -1 1087 -1 ct 1069 -1 1042 -1 1007 -1 ct 512 | p ef 513 | 1590 -406 m 1590 -436 l 1702 -441 l 1702 -255 l 1727 -276 1758 -286 1795 -286 ct 514 | 1841 -286 1878 -273 1905 -246 ct 1933 -219 1947 -184 1947 -142 ct 1947 -98 1932 -62 1903 -36 ct 515 | 1873 -9 1834 4 1787 4 ct 1751 4 1721 -9 1694 -35 ct 1663 0 l 1633 0 l 1633 -381 l 516 | 1633 -393 1631 -400 1627 -403 ct 1622 -405 1610 -406 1590 -406 ct p 517 | 1706 -63 m 1725 -34 1750 -19 1781 -19 ct 1811 -19 1834 -30 1849 -52 ct 1860 -68 1866 -98 1866 -142 ct 518 | 1866 -152 1866 -161 1865 -167 ct 1865 -173 1864 -181 1863 -192 ct 1862 -203 1860 -212 1856 -219 ct 519 | 1853 -226 1848 -234 1843 -241 ct 1837 -248 1830 -254 1821 -258 ct 1811 -261 1801 -263 1788 -263 ct 520 | 1772 -263 1756 -259 1742 -252 ct 1727 -244 1715 -234 1706 -222 ct 1706 -63 l 521 | p ef 522 | 2014 -143 m 2014 -184 2028 -219 2056 -247 ct 2084 -274 2122 -288 2171 -288 ct 523 | 2215 -288 2248 -276 2272 -253 ct 2296 -230 2308 -197 2308 -155 ct 2308 -147 2306 -142 2304 -141 ct 524 | 2301 -139 2295 -138 2287 -138 ct 2096 -138 l 2096 -60 2126 -21 2186 -21 ct 525 | 2207 -21 2225 -26 2242 -35 ct 2258 -45 2270 -57 2277 -72 ct 2279 -78 2281 -81 2282 -83 ct 526 | 2284 -85 2287 -85 2292 -85 ct 2303 -85 2308 -82 2308 -74 ct 2308 -71 2307 -67 2304 -62 ct 527 | 2302 -56 2298 -50 2292 -42 ct 2285 -34 2278 -27 2269 -20 ct 2260 -13 2247 -8 2232 -3 ct 528 | 2216 2 2199 4 2180 4 ct 2130 4 2089 -10 2059 -37 ct 2029 -64 2014 -100 2014 -143 ct 529 | p 530 | 2096 -159 m 2247 -159 l 2245 -230 2220 -265 2171 -265 ct 2145 -265 2125 -254 2111 -232 ct 531 | 2102 -219 2097 -194 2096 -159 ct p ef 532 | 2352 -1 m 2352 -30 l 2395 -30 l 2395 -227 l 2395 -239 2393 -246 2389 -248 ct 533 | 2384 -251 2372 -252 2352 -252 ct 2352 -282 l 2457 -287 l 2457 -215 l 2474 -263 2502 -287 2541 -287 ct 534 | 2559 -287 2575 -282 2588 -273 ct 2602 -264 2609 -251 2609 -235 ct 2609 -223 2605 -213 2597 -206 ct 535 | 2589 -199 2580 -196 2570 -196 ct 2560 -196 2551 -199 2543 -206 ct 2535 -213 2531 -222 2531 -235 ct 536 | 2531 -246 2535 -256 2543 -264 ct 2528 -264 2516 -260 2505 -252 ct 2494 -243 2485 -232 2480 -219 ct 537 | 2474 -206 2470 -193 2468 -180 ct 2465 -167 2464 -154 2464 -142 ct 2464 -30 l 538 | 2519 -30 l 2519 0 l 2504 -1 2475 -1 2432 -1 ct 2423 -1 2396 -1 2352 -1 ct 539 | p ef 540 | pom 541 | 0 6639 t 542 | pom 543 | count op_count sub {pop} repeat countdictstack dict_count sub {end} repeat b4_inc_state restore 544 | %%PageTrailer 545 | %%Trailer 546 | %%EOF 547 | -------------------------------------------------------------------------------- /primer/figures/logical_operations.odg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CaffeineViking/concepts-primer/041cec40fa4a25cd954ce91da6d9d10ee31499a3/primer/figures/logical_operations.odg -------------------------------------------------------------------------------- /primer/figures/overloading.odg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CaffeineViking/concepts-primer/041cec40fa4a25cd954ce91da6d9d10ee31499a3/primer/figures/overloading.odg -------------------------------------------------------------------------------- /primer/figures/screenshots.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:b685fb9631c3f1d05f733d4de31d4ca86db9ff90082acfd3b65051393fc45e1c 3 | size 47834 4 | -------------------------------------------------------------------------------- /primer/primer.bib: -------------------------------------------------------------------------------- 1 | @article{natural_syntax, 2 | author={{Stroustrup B.}}, 3 | title={{\emph{A Minimal Solution to the Concepts Syntax Problems}}}, 4 | journal={\\{Document P1079 R0}}, 5 | year={{06/05/2018}}, 6 | note={{\texttt{\href{http://wg21.link/p1079r0}{http://wg21.link/p1079r0}}}} 7 | } 8 | 9 | @article{in_place_syntax, 10 | author={{Sutter H.}}, 11 | title={{\emph{Concepts In-Place Syntax} (the post-Jacksonville variant!)}}, 12 | journal={\\{Document P0745 R1}}, 13 | year={{29/04/2018}}, 14 | note={{\texttt{\href{http://wg21.link/p0745r1}{http://wg21.link/p0745r1}}}} 15 | } 16 | 17 | @article{adjective_syntax, 18 | author={{Köppe et al.}}, 19 | title={{\emph{Yet Another Approach For Constrained Declarations}}}, 20 | journal={\\{Document P1141 R0}}, 21 | year={{23/06/2018}}, 22 | note={{\texttt{\href{http://wg21.link/p1141r0}{http://wg21.link/p1141r0}}}} 23 | } 24 | 25 | @article{the_good_concepts_paper, 26 | author={{Bjarne Stroustrup}}, 27 | title={{\emph{Concepts: The Future of Generic Programming}}}, 28 | journal={\\{Document P0557 R1}}, 29 | year={{31/01/2017}}, 30 | note={{\texttt{\href{http://wg21.link/p0557r1}{http://wg21.link/p0557r1}}}} 31 | } 32 | 33 | @article{wd, 34 | title={{\emph{Wording Paper, C++ Extension for Concepts} (C++20WD Syntax)}}, 35 | journal={\\{Document P0734 R0}}, 36 | year={{14/07/2017}}, 37 | note={{\texttt{\href{http://wg21.link/p0734r0}{http://wg21.link/p0734r0}}}} 38 | } 39 | 40 | @article{TS, 41 | title={{\emph{Working Draft, C++ Extension for Concepts} (Concepts TS Draft)}}, 42 | journal={\\{Technical Spec. D4553}}, 43 | year={{02/10/2015}}, 44 | note={{\texttt{\href{http://wg21.link/d4553}{http://wg21.link/d4553}}}}}} 45 | } 46 | 47 | @article{standard_library_concepts, 48 | author={{Casey Carter and Eric Niebler}}, 49 | title={{\emph{Standard Library Concepts} (SLC)}}, 50 | journal={\\{Document P0898 R3}}, 51 | year={{08/06/2018}}, 52 | note={{\texttt{\href{http://wg21.link/p0898r3}{http://wg21.link/p0898r3}}}} 53 | } 54 | 55 | @article{the_one_ranges_proposal, 56 | author={{Eric Niebler, Casey Carter, C. Di Bella}}, 57 | title={{\emph{The One Ranges Proposal}}}, 58 | journal={\\{Document P0896 R2}}, 59 | year={{25/06/2018}}, 60 | note={{\texttt{\href{http://wg21.link/p0896r2}{http://wg21.link/p0896r2}}}} 61 | } 62 | -------------------------------------------------------------------------------- /primer/primer.pdf: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:6f0c8dff60352f60b4dec5e9f342fcc14efa9ceac66c743f2ead1291f7315209 3 | size 377367 4 | -------------------------------------------------------------------------------- /primer/primer.tex: -------------------------------------------------------------------------------- 1 | \documentclass[a4paper, 11pt]{article} 2 | \usepackage[utf8]{inputenc} 3 | \usepackage[T1]{fontenc} 4 | \usepackage[pdftex, hidelinks, 5 | colorlinks, allcolors={blue!70!black}, 6 | pdftitle={C++ Concepts Primer}, 7 | pdfauthor={Erik Sven Vasconcelos Jansson}, 8 | pdfsubject={Programming Languages - C++}, 9 | pdfkeywords={c++, concepts}]{hyperref} 10 | 11 | \usepackage{bm} 12 | \usepackage{textcomp} 13 | \usepackage{caption} 14 | \usepackage{listings} 15 | \usepackage{pdfpages} 16 | \usepackage{booktabs} 17 | \usepackage{setspace} 18 | \usepackage{mathtools} 19 | \usepackage{blindtext} 20 | \usepackage{pgfornament} 21 | \usepackage{algorithmic} 22 | \usepackage{graphicx} 23 | \usepackage{makecell} 24 | \usepackage{courier} 25 | \usepackage{acronym} 26 | \usepackage{amssymb} 27 | \usepackage{amsthm} 28 | \usepackage{siunitx} 29 | \usepackage{relsize} 30 | \usepackage{algorithm} 31 | \usepackage{algorithm} 32 | \usepackage[capitalize, noabbrev]{cleveref} 33 | \usepackage[activate={true, nocompatibility}, final, 34 | tracking=true, kerning=true, spacing=true, 35 | factor=1100, stretch=10, shrink=10]{microtype} 36 | 37 | \makeatletter 38 | \begingroup 39 | \catcode`\$=6 % 40 | \catcode`\#=12 % 41 | \gdef\href@split$1#$2#$3\\$4{% 42 | \hyper@@link{$1}{$2}{\underline{$4}}% 43 | \endgroup 44 | }% 45 | \endgroup 46 | 47 | \newcommand\Cpp{C\nolinebreak[4]\hspace{.05em}\raisebox{.4ex}{\relsize{-3}{\textbf{++}}}} 48 | \DeclareCaptionFormat{modifiedlst}{\rule{\linewidth}{0.85pt}\\[-2.9pt]#1#2#3} 49 | \captionsetup[lstlisting]{format = modifiedlst, 50 | labelfont=bf,singlelinecheck=off,labelsep=space} 51 | \lstset{basicstyle=\footnotesize\ttfamily, 52 | breakatwhitespace = false, 53 | numberstyle=\tiny, 54 | breaklines = true, 55 | keepspaces = true, 56 | language = C++, 57 | showspaces = false, 58 | showstringspaces = false, 59 | frame = tb, 60 | numbers = left, 61 | numbersep = 5pt, 62 | xleftmargin = 16pt, 63 | framexleftmargin = 16pt, 64 | belowskip = \bigskipamount, 65 | aboveskip = \bigskipamount, 66 | escapeinside = {<@}{@>}, 67 | morekeywords = { 68 | concept, 69 | requires, 70 | noexcept, 71 | T, U, N, 72 | decltype, 73 | size_t, 74 | R, C, 75 | constexpr, 76 | point2, 77 | Matrix, 78 | NumberFactory, 79 | Range, Iterator, 80 | In1, In2, Out, 81 | }} 82 | 83 | \title{\vspace{-1.5em}\textbf{\Cpp\ Concepts Primer:}\\ 84 | \large{\emph{``defining and applying constraints''}}} 85 | \author{{\textbf{Erik Sven Vasconcelos Jansson}} \\ 86 | {\href{mailto:erik.s.v.jansson@tum.de} 87 | {\texttt{}}} \\ 88 | {at Technische Universität München}} 89 | 90 | \begin{document} 91 | 92 | \maketitle \begin{spacing}{0.94} \tableofcontents \end{spacing} 93 | 94 | \mbox{} \\ \noindent \textbf{Warning:} the author is neither an expert or a member of the standardization committee; only a fool would take everything that is written here as the truth. However, the author has tried (within his knowledge) to keep this document as accurate as possible. If you, the reader, find any mistakes in this document, please send an e-mail (or even better, create an issue on \href{https://github.com/CaffeineViking/concepts-primer}{GitHub}, and fix it!) \mbox{} \thispagestyle{empty} \newpage \pagenumbering{arabic} 95 | 96 | \input{sections/introduction.tex} 97 | \input{sections/generic_programming.tex} 98 | \input{sections/concepts.tex} \newpage 99 | \input{sections/terse_syntax.tex} \newpage 100 | \label{sec:standard_library_concepts} \input{sections/standard_library_concepts.tex} \newpage 101 | \label{sec:summary} \input{sections/summary.tex} \newpage 102 | 103 | \pagenumbering{gobble} 104 | \nocite{*} % TODO: remove 105 | \bibliographystyle{alpha} 106 | \bibliography{primer} 107 | 108 | \section*{Acknowledgements} \label{sec:acknowledgements} \input{sections/acknowledgements.tex} 109 | 110 | You may find the short \href{https://github.com/CaffeineViking/concepts-primer/blob/master/slides/slides.pdf}{presentation} for the seminar above, useful as well. 111 | 112 | \end{document} 113 | -------------------------------------------------------------------------------- /primer/sections/acknowledgements.tex: -------------------------------------------------------------------------------- 1 | \begin{itemize} 2 | \item{\textbf{Roger Orr:} for his awesome ``\emph{Concepts Lite in Practice}'' \href{https://www.youtube.com/watch?v=S1Z-RbygAlw}{talk} and for the \href{https://accu.org/index.php/journals/2246}{article} from ACCU 2016. Some motivating examples (e.g bad errors, and type traits) in this primer are borrowed (with consent) from there.} 3 | \item{\textbf{Andrew Sutton:} for another great \href{https://www.youtube.com/watch?v=_rBhX-FJCdg}{talk}: ``\emph{Generic Programming with Concepts}'' at \Cpp Now 2015. Many of the early examples in this primer are based from that talk (with some modifications); consent acquired.} 4 | \item{\textbf{Peter Sommerlad:} and the rest of the committee, for allowing me to participate in the discussion on Concepts, Modules and Contracts in the \emph{Rapperswil} 2018 EWG meeting. It was great fun, and it was very interesting to get a perspective on how the commitee operates; while the work was tiring (reading so many papers...), it was very rewarding!} 5 | \item{\textbf{Tobias Lasser:} and the rest of the teachers/participants in the course seminar ``\emph{Discovering and Teaching Modern \Cpp}'', for very interesting talks and for providing a platform where like-minded people can discuss and teach modern \Cpp\ to each other. It forced me (being really lazy), to write something that might (?) be useful (I hope?) to others as well.} 6 | \end{itemize} 7 | -------------------------------------------------------------------------------- /primer/sections/concepts.tex: -------------------------------------------------------------------------------- 1 | \section{Concepts} \label{sec:concepts} 2 | 3 | \newpage 4 | 5 | \subsection{Applying Constraints} \label{sec:applying_constraints} 6 | 7 | \subsubsection{Requires Clauses} \label{sec:requires_clauses} 8 | 9 | \lstinputlisting[linerange={6-13}]{examples/misc.cc} 10 | 11 | \begin{lstlisting} 12 | [](T x, T y) requires EqualityComparable { 13 | return x == y; 14 | }; \end{lstlisting} 15 | 16 | \lstinputlisting[linerange={18-22,52-61,138-138}]{examples/matrix.hh} 17 | 18 | \lstinputlisting[linerange={24-28}]{examples/misc.cc} 19 | 20 | \lstinputlisting[linerange={42-52}]{examples/misc.cc} 21 | 22 | \newpage 23 | 24 | \subsubsection{Overload Resolution} \label{sec:overload_resolution} 25 | 26 | \begin{figure}[h] 27 | \centering 28 | \includegraphics[width=0.7\textwidth]{figures/overloading.eps} 29 | \end{figure} 30 | 31 | \lstinputlisting[linerange={47-50,52-59,61-62}]{examples/advance.cc} 32 | 33 | \newpage 34 | 35 | \subsubsection{Logical Operations} \label{sec:logical_operations} 36 | 37 | \begin{figure}[h] 38 | \centering 39 | \includegraphics[width=0.7\textwidth]{figures/logical_operations.eps} 40 | \end{figure} 41 | 42 | \subsubsection*{Conjunctions} \label{sec:conjunctions} 43 | 44 | \lstinputlisting[linerange={30-35}]{examples/misc.cc} 45 | 46 | \subsubsection*{Disjunctions} \label{sec:disjunctions} 47 | 48 | \lstinputlisting[linerange={15-22}]{examples/misc.cc} 49 | 50 | \newpage 51 | 52 | \subsection{Defining Requirements} \label{sec:defining_requirements} 53 | 54 | \subsubsection{Requires Expressions} \label{sec:requires_expressions} 55 | 56 | \lstinputlisting[linerange={152-169}]{examples/concepts.h} 57 | 58 | \subsubsection*{Simple Requirements} \label{sec:simple_requirements} 59 | 60 | \begin{lstlisting} 61 | template 62 | concept ForwardIterator = requires { 63 | T(); 64 | T{}; 65 | }; \end{lstlisting} 66 | 67 | \subsubsection*{Type Requirements} \label{sec:type_requirements} 68 | 69 | \begin{lstlisting} 70 | template 71 | concept ForwardIterator = requires { 72 | typename std::iterator_traits::value_type; 73 | typename std::iterator_traits::difference_type; 74 | typename std::iterator_traits::reference; 75 | typename std::iterator_traits::pointer; 76 | typename std::iterator_traits::iterator_category; 77 | }; \end{lstlisting} 78 | 79 | \subsubsection*{Compound Requirements} \label{sec:compound_requirements} 80 | 81 | \begin{lstlisting} 82 | template 83 | concept ForwardIterator = requires(T x) { 84 | { *x } -> typename std::iterator_traits::reference; 85 | { ++x } -> T&; 86 | { x++ } -> T; 87 | } && requires(T x, T y) { 88 | { std::swap(x, y) } noexcept; 89 | { std::swap(y, x) } noexcept; 90 | }; \end{lstlisting} 91 | 92 | \subsubsection*{Nested Requirements} \label{sec:nested_requirements} 93 | 94 | \lstinputlisting[linerange={191-199}]{examples/concepts.h} 95 | 96 | \newpage 97 | 98 | \subsection{Giving Names to Concepts} \label{sec:giving_names_to_concepts} 99 | 100 | \lstinputlisting[linerange={175-180}]{examples/concepts.h} 101 | 102 | \lstinputlisting[linerange={182-184,186-186,188-189}]{examples/concepts.h} 103 | 104 | \subsubsection{``Good'' Concepts} \label{sec:good_concepts} 105 | -------------------------------------------------------------------------------- /primer/sections/generic_programming.tex: -------------------------------------------------------------------------------- 1 | \section{Generic Programming} \label{sec:generic_programming} 2 | 3 | Ever since the humble beginnings of \Cpp\ there's been extensive support for different kinds of \emph{polymorphism}, which can be split into two ``main'' categories: \emph{run-time} polymorphism and \emph{compile-time} polymorphism. The former is a key component in class-based OOP, and takes the form of inheritance, while the latter one enables \emph{generic programming}, and is synonymous with \emph{templates}. 4 | 5 | Templates are a bit special in \Cpp\ since they are \emph{unconstrained}. Meaning, when we \emph{instantiate} e.g. function templates, the compiler will first generate the function (that's the instantiation part) by replacing \texttt{T} with whatever type you've passed to the function, and only \underline{after}, check if the syntax is correct! This leads to some very unfortunate side-effects, as you'll see soon enough :) 6 | 7 | But before digging into the gritty details on that, let's start with a simple example of ``regular programming'' (i.e. with no templates), which we'll then use to iteratively build a scenario where generic programming will be needed. This will help us understand the though process that goes into designing a generic function, and how \emph{requirements} are gathered by the function's author. 8 | 9 | Below is a function that calculates the arithmetic mean by taking in two pointers to a C-style array of \texttt{doubles}, one for the first, and last elements. Notice, that even if we would mangle the names, we would still recognize this as the \texttt{mean}, since the operations (summing elements and dividing by size), would still be familiar to us, since we know what \texttt{\{\}}, \texttt{+=}, \texttt{/} do to \texttt{doubles}. 10 | 11 | \lstinputlisting[linerange={3-10}]{examples/mean.cc} 12 | 13 | \noindent By using \emph{operator overloading}, we can make our user-defined types behave just like built-in types. This is very powerful, because it allows us to transfer our knowledge about e.g. \texttt{doubles}, and apply it for our own types as well, by using the \underline{\emph{same syntax}} as before. This last part is particularly important! 14 | 15 | \lstinputlisting[linerange={6-16}]{examples/point2.hh} 16 | 17 | \lstinputlisting[linerange={5-12}]{examples/centroid.cc} 18 | 19 | \noindent As can be seen above, providing all those overloads to \texttt{point2} proved fruitful, since we can now represent the algorithm to find the centroid of a cluster of points in a very natural way, quite similarly to how we did the \texttt{mean} function. In fact, this function is \emph{exactly} the same as \texttt{mean}, with the only difference being that the type \texttt{double} $\rightarrow$ \texttt{point2} and that now \texttt{mean} $\rightarrow$ \texttt{centroid}. Surely there must be a way to generalize this type of ``coincidence'' in \Cpp? If you've done any GP at all before, you probably know where this is going! 20 | 21 | \vspace{1em}\noindent\textbf{Note:} these are \underline{not} good examples on how you should write these functions, for instance, what happens when \texttt{begin >= end}? And why use pointers? Many examples in this primer are like this too, so don't use it in production! 22 | 23 | \subsection{Unconstrained Templates} \label{sec:unconstrained_templates} 24 | 25 | Obviously, both \texttt{mean} and \texttt{centroid} are trying to find an \texttt{average}, which we can express as a higher-level idea with \emph{function templates}, as shown below. We've essentially just swapped \texttt{double}/\texttt{point2} by \texttt{T}, a \emph{template parameter}. These are defined in \emph{template parameter lists}, which have either \emph{type} or \emph{non-type template parameters}. By default, template parameters are \emph{unconstrained}, which means they may take \emph{any} type or value (using non-type parameters). 26 | 27 | Now, assume you're a user of this function, and wish to use it with your own user-defined type. What are the \emph{requirements} our type needs to \emph{satisfy}? As authors of this function, we know \texttt{T} needs to be \texttt{DefaultConstructible} in line 4, \texttt{Summable} with \texttt{T} in line 7, and \texttt{Scalable} by \texttt{double} in line 8. However, the user doesn't know that, and there's no way to tell by looking at the function signature... Do we have to go and look at the implementation? 28 | 29 | While that might work for this short toy example, it certainly won't scale. A possible solution (adopted by the STL) is to document everything on paper. 30 | 31 | \lstinputlisting[linerange={7-7,11-18}]{examples/average.cc} 32 | 33 | While writing documentation for the requirements on \texttt{T} certainly works, there is no guarantee the user will read it. And even if the user \emph{does} read it, there is still the possibility he/she will implement the requirements incorrectly. \textbf{Note:} for a ``good'' example on this, see: \emph{Type Requirements} in \href{https://en.cppreference.com/w/cpp/algorithm/sort}{\texttt{std::sort}}. 34 | 35 | Another reasonable alternative, and probably the most common approach, is to implement the requirements iteratively by \emph{trial-and-error}. We just let the compiler try to instantiate the template, and the hope is that the compiler will tell us what requirements are missing, so we can implement them. Even this approach is problematic for the user. For instance, consider this snippet: 36 | 37 | \begin{lstlisting} 38 | std::list l { 5, 1, 2, 4, 3 }; 39 | std::sort(l.begin(), l.end()); \end{lstlisting} 40 | 41 | \noindent Spits around 50 lines of template instantiation errors in GCC 8.1. While this is actually pretty tame, and not that hard to figure out what's wrong, it will still scare away a lot of people. The compiler is somewhat helpful, and colors e.g. the \texttt{std::\_\_lg(\_\_last - \_\_first) * 2}, telling us that it can't compile because \texttt{std::\_List\_iterator} doesn't have \texttt{operator-}. However, the most helpful hint is hidden away between those lines, and the true cause is that \texttt{std::list} uses \texttt{ForwardIterators}, and \texttt{std::sort} expects a pair of \texttt{RandomAccessIterators}. Both of these are concepts, and their requirements are defined in the standard library specification. The programmer needs to the read documentation to locate the problem anyway! 42 | 43 | To put a little bit more salt to the wound, consider this simple example: 44 | 45 | \begin{lstlisting} 46 | std::set w; // defined as struct Widget { }; elsewhere 47 | w.insert(Widget{}); \end{lstlisting} 48 | 49 | \noindent Gives around 412 lines of template instantiation errors. This is still pretty tame in comparison to what some templated libraries output when you make a small mistake, and some of the longer errors even crash terminal emulators! Why can't we just get the same quality of errors as with non-templated code? 50 | 51 | There is a reason why compilers can't be more helpful in these situations. As I've mentioned before, unconstrained templates only validate syntax \emph{after} the template has been instantiated, which means it's very hard to track down the source of the problem. Especially if the instantiation error happens far from the ``call site'', resulting in a long \emph{template instantiation stack}. It's so hard in fact, that compilers don't even needed to provide any diagnostics for these problems (according to the standard). Luckily, compilers still try, but the chances for these error messages getting vastly better in future compiler versions are slim, since these problems are equivalent to the \emph{halting problem}. 52 | 53 | It seems we've hit a dead-end with unconstrained templates. Maybe we'll just have to endure the pain of using templated code, or consider it a rite of passage for every \Cpp\ programmer that wishes to venture forth. We'll just have to live with fragile template interfaces and unintuitive error messages... 54 | 55 | \subsubsection*{Concepts to the Rescue!} 56 | 57 | Don't fear, concepts is here! Below we have the \texttt{average} from before, with the exception of lines 2-4, which have been squeezed in-between the template parameter list and the function signature. These apply \emph{type constraints} on \texttt{T}, which are just a set of \emph{predicates} that must be \emph{fulfilled} \underline{before} instantiation. 58 | 59 | Without getting boggled down on syntax (we'll have plenty of that later), lines 2-4 say that: we require \texttt{T} to be \texttt{DefaultConstructible}, \texttt{T} must also be \texttt{SummableWith} another \texttt{T}, and \texttt{T} has to be \texttt{ScalableWith} a \texttt{double}. All of these concepts together constrain \texttt{T} to a set of types we want to allow. 60 | 61 | \lstinputlisting[linerange={7-18}]{examples/average.cc} 62 | 63 | \noindent Even though that seems pretty neat, what have we gained from doing this? Apart from the extra verboseness, function authors now need to spend time thinking about the constraints on \texttt{T}, which might seem like ``a waste of time''. After all, it's not like there aren't implicit ``constraints'' already defined in the body of the function: giving a ``bad'' \texttt{T} won't compile, even without concepts. There needs to be a good reason \emph{why} this extra verboseness is needed at all! 64 | 65 | Luckily, this extra verboseness solves a lot of the problems we've described, and easily outweigh the cost of having to write a couple of extra lines of code. Because the constraints on \texttt{T} are checked \emph{before} instantiation occurs, a more reasonable error message can be displayed instead of the ``junk'' we get today. Also, because constraints are part of the function signature, the interface is no longer fragile, and the user can see what concepts they need to implement. 66 | 67 | This completely eliminates the need to document template requirements, because the constraints are explicitly stated in the function signature. Also, the ``trial-and-error'' approach to implementing requirements is no longer unreasonable, because the compiler can now give (more) useful information! Calling \texttt{std::sort} with a \texttt{std::list} will now give something similar to: \emph{``constraints not satisfied: \texttt{std::list::iterator} is not \texttt{RandomAccess}''}, followed by a concise summary of all the requirements you need to implement. 68 | 69 | Also, concepts allow us to overload function templates using constraints. However, we've been able to do that for a while now, by using \emph{type traits} and SFINAE, or even with \emph{tag dispatching}. In fact, both of these are ``competitors'' to concepts, and fill similar niches. Let's have a look at both of these as well! 70 | 71 | \subsection{Type Traits and SFINAE} \label{sec:type_traits_and_sfinae} 72 | 73 | Even though this primer is mainly focused on concepts, it would be foolish not to compare it with existing methods that already limit template parameters. One of these are \emph{type traits + SFINAE (Substitution Failure Is Not An Error)}. Despite the scary looking acronym, the idea behind SFINAE is quite simple: ``if replacing \texttt{T} gives invalid syntax, don't emit an error, find alternatives first'', which means we can ``swap'' between overloads depending on these ``failures''. 74 | 75 | And this is where type traits come in handy, since they allow us to ``trigger'' these failures by using them together with \texttt{enable\_if}, a compile-time switch, which evaluates to a non-failing type if the type trait is satisfied. The type traits themselves are just clever constructs that evaluate to \texttt{true} when \texttt{T} has certain properties, e.g. \texttt{is\_integral\_v} gives us \texttt{true}. One of the problems with type traits is that they are not obvious to specify. 76 | 77 | \noindent \textbf{Note:} for a deeper dive see \emph{Bendersky's} \href{https://eli.thegreenplace.net/2014/sfinae-and-enable_if/}{SFINAE and \texttt{enable\_if}} blog post. 78 | 79 | For instance, \texttt{EqualityComparable} from the \Cpp11 standard library: 80 | 81 | \begin{table}[h] 82 | \begin{tabular}{ccc} 83 | \toprule 84 | \bf{Expression} & \bf{Return Type} & \bf{Requirement Specification} \\ 85 | \midrule 86 | \texttt{x == y} & \textbf{\texttt{bool}} convertible & \makecell[l]{\texttt{==}\, is an equivalence relation, that is,\\ 87 | it has the following properties:\\ 88 | $\rightarrow$ for all \texttt{x}, \texttt{x == x}\\ 89 | $\rightarrow$ if \texttt{x == y}, then \texttt{y == x}\\ 90 | $\rightarrow$ if \texttt{x == y}, \texttt{y == z}, then \texttt{x == z}} \\ 91 | \bottomrule 92 | \end{tabular} 93 | \end{table} 94 | 95 | \noindent could be defined as the type trait below, which gives \texttt{true} iff \texttt{T} and \texttt{U} have \texttt{operator==(T,U)}. While this wasn't all that complicated in this case, it's still annoying that 87.5\% of this code is just pure boilerplate. It's line 7 that is actually doing the heavy lifting, everything else is just ``unnecessary'' code. Also, if you're very observant, you'll notice that this type trait doesn't even satisfy all of the requirements above, since it doesn't support commutativity. 96 | 97 | Even line 7 isn't obvious, since we need to use \texttt{std::declval} to acquire references to \texttt{T} and \texttt{U} that don't need to go through constructors, so that they can be evaluated with \texttt{decltype}, and finally do what we came to do: check if \texttt{operator==(T,U)} is available. I hope that you will agree that this seems like an awfully roundabout way of doing this. And this is one of the easier type traits to specify, expect extra machinery for anything less trivial. 98 | 99 | \lstinputlisting[linerange={6-13}]{examples/sfinae.hh} 100 | 101 | \subsubsection*{Concepts to the Rescue!} 102 | 103 | Don't fear, concepts is here! Why do we have to go through all that trouble? In the end, the problem we're trying to solve is simple: for any \texttt{T} and \texttt{U}, check if \texttt{x == y} and \texttt{y == x} are expressions that compile (where \texttt{x} $\in$ \texttt{T}, \texttt{y} $\in$ \texttt{U}). Below we define \texttt{EqualityComparable} by using concepts. Prettier, right? 104 | 105 | Again, without delving too much into the syntax, line 2 defines a concept called \texttt{EqualityComparableWith}, that requires for any \texttt{x} $\in$ \texttt{T} and \texttt{y} $\in$ \texttt{U}: \texttt{x == y}, \texttt{x != y}, \texttt{y != x}, \texttt{y == x}, be valid expressions evaluable to \texttt{bool}. e.g. \texttt{EqualityComparableWith} gives \texttt{true}, because \texttt{std::string} has all operators for comparing C-style strings. Note that this is way more powerful than \texttt{is\_equality\_comparable} since it also checks commutativity properties. Something that might be surprising is that it's also non-equality comparable, and is a trend you'll see with ``good'' concept definitions, since they \emph{prefer complete} rather than \emph{minimal} concepts. 106 | 107 | Back in the \texttt{average} example, where we apply constraints via concepts, you might have been wondering how to define e.g. \texttt{DefaultConstructible}. And you'll be pleased to know all of them are really simple to define as well, just like the one below! If you want to take a peek: \texttt{examples/concepts.h}. 108 | 109 | \lstinputlisting[linerange={57-63}]{examples/concepts.h} 110 | 111 | \noindent And now for something completely different, but still related to type traits, and more specifically, the many issues with SFINAE. Consider this example: a factory which creates different numbers depending on the constructor that was called. If \texttt{NumberFactory} is called with an integer type, \texttt{create\_number} returns \texttt{42}, but if it's a floating point type, we get e.g. \texttt{0xDEADBEEF} instead. 112 | 113 | \lstinputlisting[linerange={8-22}]{examples/factory.hh} 114 | 115 | Sounds simple right? And one would expect the \texttt{NumberFactory} in the previous page to already work, since we're eliminating the ``bad'' constructors with SFINAE, via the \texttt{is\_integral} \& \texttt{is\_floating\_point} type traits. However, that doesn't quite work, because the call will be ambiguous. SFINAE isn't part of overload resolution. As far as the compiler knows, both constructors are exactly the same. How to fix this? We make them different!: 116 | 117 | \lstinputlisting[linerange={28-44}]{examples/factory.hh} 118 | 119 | \noindent Essentially, by introducing a \texttt{dummy} argument, we have changed the signature of the function, which means the compiler no longer considers this ambiguous, and SFINAE can finally take over as usual. While this works, I'd like to argue that this isn't nice, and causes unnecessary headaches for something so simple. Wouldn't it be awesome to not have to think about these edge-cases anymore? 120 | 121 | \subsubsection*{Concepts to the Rescue!} 122 | 123 | Don't fear, concepts is here! Since constraints are part of overload resolution, the compiler won't consider these constructors ambiguous anymore. In fact, constraints are part of the function's signature! No more edge-cases with this! 124 | 125 | \lstinputlisting[linerange={50-62}]{examples/factory.hh} 126 | 127 | \subsection{Tag Dispatching} \label{sec:tag_dispatching} 128 | 129 | Another generic programming technique, heavily used in the \Cpp\ standard library, is \emph{tag dispatching} together with \emph{trait classes}. It's a way to choose the function to call/dispatch depending on the properties of a type by using \emph{tags}. A tag is just an empty class (déjà vu?) used to control the function dispatch. 130 | 131 | This is better explained with an example, which I've shamelessly borrowed from \emph{Boost's} excellent \href{https://www.boost.org/community/generic_programming.html#tag_dispatching}{Generic Programming Techniques} survey. If you've played around with \texttt{std::advance} before, you'll know that it's an algorithm which increments an iterator $n$ times, and gives you that ``advanced'' iterator. What you might \emph{not} know, is that there are two versions of it: one which runs in $\mathcal{O}(n)$ time, and another in $\mathcal{O}(1)$ time, depending on the properties of the type that was passed. Which makes sense when you think about it, since a \texttt{ForwardIterator} can only call \texttt{++i} while a \texttt{RandomAccessIterator} can just directly call \texttt{i += n}. It does this by using tag dispatching, like this: 132 | 133 | \lstinputlisting[linerange={13-31}]{examples/advance.cc} 134 | 135 | \noindent Notice that \texttt{tagged\_advance} needs an extra argument in the end: the tag, which is used to dispatch the right \texttt{tagged\_advance} from within \texttt{advance}. It does this selection by using \texttt{iterator\_traits::category}, which is a pre-defined type alias for finding out what type of iterator \texttt{T} is. This is quite an elegant approach, but requires us to specify new ``empty'' classes for new iterator types. Worst of all though, we need to provide a specialization inside the \texttt{iterator\_traits} class! Isn't there a better way to solve this? 136 | 137 | \lstinputlisting[linerange={36-40}]{examples/advance.cc} 138 | 139 | \subsubsection*{Concepts to the Rescue!} 140 | 141 | Don't fear, concepts is here! Instead of having to control dispatch with a tag, how about choosing the correct function overload right from the start? With concepts, this is possible, since we can specify the properties on \texttt{T} explicitly! 142 | 143 | \lstinputlisting[linerange={47-50,52-59,61-62}]{examples/advance.cc} 144 | 145 | \noindent At this point, you should be somewhat convinced that concepts are neat, and that existing \Cpp\ language features aren't ``good'' enough for some scenarios. It's finally time to actually start talking about Concepts! I hope you're hyped! 146 | -------------------------------------------------------------------------------- /primer/sections/introduction.tex: -------------------------------------------------------------------------------- 1 | \section{Introduction} \label{sec:introduction} 2 | 3 | Right now \Cpp\ is experiencing a \emph{renaissance}, fueled by new language features and an extended standard library introduced with \Cpp11, \Cpp14, and \Cpp17. It's a different beast than \Cpp98 (want to feel old?: that's two decades ago!), while still keeping to its core philosophies: the \emph{zero-overhead principle}, having a \emph{simple \& direct mapping to hardware}, and to be completely \emph{multi-paradigm}. The language has become more powerful, but also simpler, since a lot of the rough edges in \Cpp98 have been removed, or replaced, with modern variants. Interest in \Cpp\ has surged again, and with \Cpp20 coming soon\texttrademark, doubly so. 4 | 5 | \Cpp20 is expected to bring features such as \emph{Contracts}, \emph{Coroutines}, \emph{Ranges}, and \emph{Concepts} to the language. Each one of these features deserves their own version of this primer, a self-contained, textbook-style way to introduce people to these features. It should motivate why this feature is needed, what problems it's trying to solve, and present previous alternatives already in the language. After explaining where these existing methods fall short, the feature is shown, demonstrating in which cases it's better than the alternatives. Finally, the featured syntax is presented by using short (to the point!) practical examples. 6 | 7 | In this primer we'll be looking at Concepts, a way to \emph{constrain templates}, which leads to: \emph{clearer template errors}, a way to \emph{overload based on constraints}, and more \emph{explicitly defined function template interfaces} by using requirements. The goals of this primer are to teach you how to \emph{apply constraints} to template parameters by using the \emph{requires clause}, and how to \emph{define} your own set of \emph{requirements} by using the various forms of \emph{requires expressions}. You'll then see that we can compose requirements together to form useful \emph{concepts}, that can be used together with \emph{terse syntax}, for writing less verbose generic code. 8 | 9 | The primer has the following structure: in \cref{sec:generic_programming} we present the state of \emph{generic programming} with \emph{unconstrained templates}, and some of its problems. We then show some solutions (e.g. type traits), where they fall short, and where concepts may help. In \cref{sec:concepts} we introduce concepts, and show how \emph{requires clauses} together with \emph{requires expressions} can constrain templates. The three major terse syntax proposals are then presented in \cref{sec:terse_syntax}, and is followed by \cref{sec:standard_library_concepts} with an overview of the \emph{concepts and ranges library}. Finally, we wrap things up in \cref{sec:summary}, and see what the future might hold! 10 | 11 | \subsection*{Building Examples} 12 | 13 | Alongside this document you'll find plenty of examples on how to use concepts, and you'll be happy to know \emph{almost} all of them compile out-of-the-box when using GCC with the \texttt{-fconcepts} flag! If you are a boring person, you can clone the \href{https://github.com/CaffeineViking/concepts-primer/tree/master/primer/examples}{repository}, or, if you're feeling adventurous, \emph{unzip} this PDF with: 14 | 15 | \begin{lstlisting}[language=bash, morekeywords={unzip, make}, 16 | deletekeywords={test}] 17 | unzip concepts-primer.pdf 18 | cd examples 19 | make gcc-test && make -j8 20 | \end{lstlisting} 21 | -------------------------------------------------------------------------------- /primer/sections/standard_library_concepts.tex: -------------------------------------------------------------------------------- 1 | \section{Standard Library Concepts} \label{sec:standard_library_concepts} 2 | 3 | \subsection{The Ranges Library} \label{sec:the_ranges_library} 4 | 5 | \begin{lstlisting} 6 | std::vector v { 10, 2, 6, 10, 4, 1, 9, 5, 8, 3 }; 7 | v = std::move(v) | action::sort | action::unique; \end{lstlisting} 8 | 9 | \begin{lstlisting} 10 | auto r = v | view::remove_if([](int i){ return (i % 2) == 1; }) 11 | | view::transform([](int i){ return to_string(i); }) 12 | | view::take(4); \end{lstlisting} 13 | -------------------------------------------------------------------------------- /primer/sections/summary.tex: -------------------------------------------------------------------------------- 1 | \section{Summary} \label{sec:summary} 2 | 3 | \subsection*{Current Status} 4 | 5 | Below follows the current status and release forecast for the features touched upon in this primer. Most are derived in \emph{Herb Sutter's} excellent \href{https://herbsutter.com/2018/07/02/trip-report-summer-iso-c-standards-meeting-rapperswil/}{Trip Report}, but I've also taken into account various other sources, along with my biased predictions based on the experiences from the Rapperswil 2018 \Cpp\ meeting. 6 | 7 | \begin{itemize} 8 | \item{\textbf{Concepts:}} 9 | \item{\textbf{Terse Syntax:}} 10 | \item{\textbf{Standard Library Concepts:}} 11 | \item{\textbf{Ranges:}} 12 | \end{itemize} 13 | -------------------------------------------------------------------------------- /primer/sections/terse_syntax.tex: -------------------------------------------------------------------------------- 1 | \section{Terse Syntax} \label{sec:terse_syntax} 2 | 3 | \lstinputlisting[linerange={6-23,36-37}]{examples/zero.cc} 4 | 5 | \newpage 6 | 7 | \subsection{Natural Syntax} \label{sec:natural_syntax} 8 | 9 | \lstinputlisting[linerange={6-23,36-37}]{examples/natural.cc} 10 | 11 | \newpage 12 | 13 | \subsection{Concepts In-Place Syntax} \label{sec:concepts_in-place_syntax} 14 | 15 | \lstinputlisting[linerange={6-23,36-37}]{examples/in-place.cc} 16 | 17 | \newpage 18 | 19 | \subsection{Constrained \texttt{auto} Syntax} \label{sec:constrained_auto_syntax} 20 | 21 | \lstinputlisting[linerange={6-23,36-37}]{examples/adjective.cc} 22 | -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | A C++ Concepts Primer 2 | ===================== 3 | 4 |

C++ Concepts Primer

5 | 6 | Introduction 7 | ------------ 8 | 9 | Right now C++ is experiencing a *renaissance*, fueled by new language features and an extended standard library introduced with C++11, C++14, and C++17. It is a different beast than C++98 (want to feel really old? that's ~two decades ago!), while still keeping to its core philosophies: the *zero-overhead principle*, having a *simple and direct mapping to hardware*, and to be completely *multi-paradigm*. The language has become more powerful, but also simpler, since many of the "rough edges" in C++98 have been removed and replaced with more modern variants, that are safer and more general to use. Interest in the C++ programming language has surged again, and with C++20 coming soon™ doubly so. Concepts will be in C++20 folks! 10 | 11 | In this primer we'll be looking at *concepts*, a way to *constrain templates*, which lead to: *less verbose template errors*, a way to *overload functions based on constraints*, and more *explicitly defined function template interfaces* by using requirements. This primer will teach you how to *apply constraints* to template parameters by using the *requires clause*, and how to *define* your own set of *requirements* by using the many forms of *requires expression*. You'll then see that we can compose requirements together to form useful *concepts*, which can be used together with *terse syntax* to write safe and less verbose generic code. 12 | 13 | Documents 14 | --------- 15 | 16 | * **[Primer (pdf)](primer/primer.pdf):** the primer itself, which consists of a short overview of *generic programming* in a pre-concepts world, the problems with using *unconstrained template parameters*, what methods we currently have (e.g. *type traits and SFINAE*) for solving these or similar problems, and why they are *insufficient*. We then present *Concepts*, which are a method to *constrain template parameters* by using `requires` *clauses* and `requires` *expressions*. The primer also covers *standard library concepts*, their use in the *ranges* proposal, and their different *terse syntax* proposed for C++20 (which is more a historical curiosity nowadays, since the syntax has already been selected now). **Warning!** This is still **work in progress**! 17 | * **[Slides (pdf)](slides/slides.pdf):** essentially the same information as the above, but condensed, and not as good. Good for a quick read :). 18 | 19 | Typesetting 20 | ----------- 21 | 22 | Both the primer and the slides are typeset with *LaTeX*, and are available as PDFs in the section above, but if if you still want to typeset the latest version for some reason, here is how to do it (in *TeXLive*): go into `primer` or `slides`, and then call `make`. 23 | 24 | Examples 25 | -------- 26 | 27 | Almost all examples in the primer should be runnable after doing the hack in `concepts.h`. In fact, I would recommend you to just import `concepts.h` if you want to play around with concepts. The only examples that aren't runnable, are those that use the more novel *terse syntaxes* (i.e. *concepts in-place syntax* and the *adjective syntax*). The *natural syntax* as in the TS:es should work fine. You can compile all examples in the primer by going to `primer/listings` and calling `make`. Since snippets in the primer is taken directly from these listings, everything you see in the primer is syntactically correct as they can be built / run. 28 | 29 | Acknowledgements 30 | ---------------- 31 | 32 | * **Roger Orr:** for his awesome [*Concepts Lite in Practice*](https://www.youtube.com/watch?v=S1Z-RbygAlw) talk and for the [article](https://accu.org/index.php/journals/2246) from ACCU 2016. Some motivating examples (e.g bad errors, and type traits) in this primer are borrowed (with consent) from there. 33 | * **Andrew Sutton:** for another great [talk](https://www.youtube.com/watch?v=_rBhX-FJCdg): *Generic Programming with Concepts* at C++Now 2015. Many of the early examples in this primer are based from that talk (with some modifications). 34 | * **Peter Sommerlad:** and the rest of the committee, for allowing me to participate in the discussion on Concepts, Modules and Contracts in the *Rapperswil* 2018 EWG meeting. It was great fun, and it was very interesting to get a perspective on how the commitee operates; while the work was tiring, it was very rewarding! 35 | * **Tobias Lasser:** and the rest of the teachers/participants in the course seminar *Discovering and Teaching Modern C++*, for the very interesting talks and for providing a platform where like-minded people can discuss and teach modern C++ to each other. It forced me (being really lazy), to write something that might (?) be useful (I hope?) to others. 36 | 37 | References 38 | ---------- 39 | 40 | * Bjarne Stroustrup. Concepts: The Future of Generic Programming. Document P0557 R1, 31/01/2017. 41 | * Casey Carter and Eric Niebler. Standard Library Concepts (SLC). Document P0898 R3, 08/06/2018. 42 | * Eric Niebler, Casey Carter, C. Di Bella. The One Ranges Proposal. Document P0896 R2, 25/06/2018. 43 | * Köppe et al. Yet Another Approach For Constrained Declarations. Document P1141 R0, 23/06/2018. 44 | * Stroustrup B. A Minimal Solution to the Concepts Syntax Problems. Document P1079 R0, 06/05/2018. 45 | * Sutter H. Concepts In-Place Syntax (the post-Jacksonville variant!). Document P0745 R1, 29/04/2018. 46 | * Working Draft, C++ Extension for Concepts (Concepts TS Draft). Technical Spec. D4553, 02/10/2015. 47 | * Wording Paper, C++ Extension for Concepts (C++20WD Syntax). Document P0734 R0, 14/07/2017. 48 | -------------------------------------------------------------------------------- /slides/.gitignore: -------------------------------------------------------------------------------- 1 | build 2 | 3 | ## Core latex/pdflatex auxiliary files: 4 | *.aux 5 | *.lof 6 | *.log 7 | *.lot 8 | *.fls 9 | *.out 10 | *.toc 11 | *.fmt 12 | *.fot 13 | *.cb 14 | *.cb2 15 | 16 | ## Intermediate documents: 17 | *.dvi 18 | *-converted-to.* 19 | # these rules might exclude image files for figures etc. 20 | # *.ps 21 | # *.eps 22 | # *.pdf 23 | 24 | ## Bibliography auxiliary files (bibtex/biblatex/biber): 25 | *.bbl 26 | *.bcf 27 | *.blg 28 | *-blx.aux 29 | *-blx.bib 30 | *.brf 31 | *.run.xml 32 | 33 | ## Build tool auxiliary files: 34 | *.fdb_latexmk 35 | *.synctex 36 | *.synctex.gz 37 | *.synctex.gz(busy) 38 | *.pdfsync 39 | 40 | ## Auxiliary and intermediate files from other packages: 41 | # algorithms 42 | *.alg 43 | *.loa 44 | 45 | # achemso 46 | acs-*.bib 47 | 48 | # amsthm 49 | *.thm 50 | 51 | # beamer 52 | *.nav 53 | *.snm 54 | *.vrb 55 | 56 | # cprotect 57 | *.cpt 58 | 59 | # fixme 60 | *.lox 61 | 62 | #(r)(e)ledmac/(r)(e)ledpar 63 | *.end 64 | *.?end 65 | *.[1-9] 66 | *.[1-9][0-9] 67 | *.[1-9][0-9][0-9] 68 | *.[1-9]R 69 | *.[1-9][0-9]R 70 | *.[1-9][0-9][0-9]R 71 | *.eledsec[1-9] 72 | *.eledsec[1-9]R 73 | *.eledsec[1-9][0-9] 74 | *.eledsec[1-9][0-9]R 75 | *.eledsec[1-9][0-9][0-9] 76 | *.eledsec[1-9][0-9][0-9]R 77 | 78 | # glossaries 79 | *.acn 80 | *.acr 81 | *.glg 82 | *.glo 83 | *.gls 84 | *.glsdefs 85 | 86 | # gnuplottex 87 | *-gnuplottex-* 88 | 89 | # hyperref 90 | *.brf 91 | 92 | # knitr 93 | *-concordance.tex 94 | # TODO Comment the next line if you want to keep your tikz graphics files 95 | *.tikz 96 | *-tikzDictionary 97 | 98 | # listings 99 | *.lol 100 | 101 | # makeidx 102 | *.idx 103 | *.ilg 104 | *.ind 105 | *.ist 106 | 107 | # minitoc 108 | *.maf 109 | *.mlf 110 | *.mlt 111 | *.mtc 112 | *.mtc[0-9] 113 | *.mtc[1-9][0-9] 114 | 115 | # minted 116 | _minted* 117 | *.pyg 118 | 119 | # morewrites 120 | *.mw 121 | 122 | # mylatexformat 123 | *.fmt 124 | 125 | # nomencl 126 | *.nlo 127 | 128 | # sagetex 129 | *.sagetex.sage 130 | *.sagetex.py 131 | *.sagetex.scmd 132 | 133 | # sympy 134 | *.sout 135 | *.sympy 136 | sympy-plots-for-*.tex/ 137 | 138 | # pdfcomment 139 | *.upa 140 | *.upb 141 | 142 | # pythontex 143 | *.pytxcode 144 | pythontex-files-*/ 145 | 146 | # thmtools 147 | *.loe 148 | 149 | # TikZ & PGF 150 | *.dpth 151 | *.md5 152 | *.auxlock 153 | 154 | # todonotes 155 | *.tdo 156 | 157 | # easy-todo 158 | *.lod 159 | 160 | # xindy 161 | *.xdy 162 | 163 | # xypic precompiled matrices 164 | *.xyc 165 | 166 | # endfloat 167 | *.ttt 168 | *.fff 169 | 170 | # Latexian 171 | TSWLatexianTemp* 172 | 173 | ## Editors: 174 | # WinEdt 175 | *.bak 176 | *.sav 177 | 178 | # Texpad 179 | .texpadtmp 180 | 181 | # Kile 182 | *.backup 183 | 184 | # KBibTeX 185 | *~[0-9]* 186 | -------------------------------------------------------------------------------- /slides/Makefile: -------------------------------------------------------------------------------- 1 | name := slides 2 | viewer := mupdf 3 | all: $(name).pdf 4 | view: $(name).pdf 5 | $(viewer) $(name).pdf 6 | $(name).pdf: $(name).tex $(name).bib 7 | mkdir -p build 8 | pdflatex -output-directory build/ $(name) 9 | bibtex build/$(name) 10 | pdflatex -output-directory build/ $(name) 11 | pdflatex -output-directory build/ $(name) 12 | mv build/$(name).pdf . 13 | clean: 14 | rm -rf build 15 | distclean: clean 16 | rm -f $(name).pdf 17 | .PHONY: all clean 18 | -------------------------------------------------------------------------------- /slides/figures/applying.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CaffeineViking/concepts-primer/041cec40fa4a25cd954ce91da6d9d10ee31499a3/slides/figures/applying.png -------------------------------------------------------------------------------- /slides/figures/defining.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CaffeineViking/concepts-primer/041cec40fa4a25cd954ce91da6d9d10ee31499a3/slides/figures/defining.png -------------------------------------------------------------------------------- /slides/figures/iterators.eps: -------------------------------------------------------------------------------- 1 | %!PS-Adobe-3.0 EPSF-3.0 2 | %%BoundingBox: 0 0 223 223 3 | %%Pages: 0 4 | %%Creator: LibreOffice 6.0 5 | %%Title: none 6 | %%CreationDate: none 7 | %%LanguageLevel: 2 8 | %%EndComments 9 | %%BeginProlog 10 | %%BeginResource: procset SDRes-Prolog 1.0 0 11 | /b4_inc_state save def 12 | /dict_count countdictstack def 13 | /op_count count 1 sub def 14 | userdict begin 15 | 0 setgray 0 setlinecap 1 setlinewidth 0 setlinejoin 10 setmiterlimit[] 0 setdash newpath 16 | /languagelevel where {pop languagelevel 1 ne {false setstrokeadjust false setoverprint} if} if 17 | /bdef {bind def} bind def 18 | /c {setrgbcolor} bdef 19 | /l {neg lineto} bdef 20 | /rl {neg rlineto} bdef 21 | /lc {setlinecap} bdef 22 | /lj {setlinejoin} bdef 23 | /lw {setlinewidth} bdef 24 | /ml {setmiterlimit} bdef 25 | /ld {setdash} bdef 26 | /m {neg moveto} bdef 27 | /ct {6 2 roll neg 6 2 roll neg 6 2 roll neg curveto} bdef 28 | /r {rotate} bdef 29 | /t {neg translate} bdef 30 | /s {scale} bdef 31 | /sw {show} bdef 32 | /gs {gsave} bdef 33 | /gr {grestore} bdef 34 | /f {findfont dup length dict begin 35 | {1 index /FID ne {def} {pop pop} ifelse} forall /Encoding ISOLatin1Encoding def 36 | currentdict end /NFont exch definefont pop /NFont findfont} bdef 37 | /p {closepath} bdef 38 | /sf {scalefont setfont} bdef 39 | /ef {eofill}bdef 40 | /pc {closepath stroke}bdef 41 | /ps {stroke}bdef 42 | /pum {matrix currentmatrix}bdef 43 | /pom {setmatrix}bdef 44 | /bs {/aString exch def /nXOfs exch def /nWidth exch def currentpoint nXOfs 0 rmoveto pum nWidth aString stringwidth pop div 1 scale aString show pom moveto} bdef 45 | %%EndResource 46 | %%EndProlog 47 | %%BeginSetup 48 | %%EndSetup 49 | %%Page: 1 1 50 | %%BeginPageSetup 51 | %%EndPageSetup 52 | pum 53 | 0.02831 0.02831 s 54 | 0 -7875 t 55 | /tm matrix currentmatrix def 56 | tm setmatrix 57 | -9760 -7220 t 58 | 1 1 s 59 | gs 60 | 1.000 1.000 1.000 c 13697 15093 m 9761 15093 l 9761 7221 l 17633 7221 l 61 | 17633 15093 l 13697 15093 l p ef 62 | gr 63 | gs 64 | 0 lw 1 lj 1.000 1.000 1.000 c 13696 15093 m 9760 15093 l 9760 7221 l 65 | 17632 7221 l 17632 15093 l 13696 15093 l pc 66 | gr 67 | gs 68 | 1.000 1.000 1.000 c 13697 7348 m 15856 7348 17506 8998 17506 11157 ct 17506 13317 15856 14966 13697 14966 ct 69 | 11537 14966 9887 13317 9887 11157 ct 9887 8998 11537 7348 13697 7348 ct p 70 | 9887 7348 m 9887 7348 l p 71 | 17507 14967 m 17507 14967 l p ef 72 | gr 73 | gs 74 | 34.99111 lw 1 lj 0.003 0.003 0.003 c 13696 7348 m 15855 7348 17505 8997 17505 11157 ct 75 | 17505 13316 15855 14966 13696 14966 ct 11537 14966 9887 13316 9887 11157 ct 76 | 9887 8997 11537 7348 13696 7348 ct pc 77 | gr 78 | gs 79 | 34.99111 lw 1 lj 0.003 0.003 0.003 c 9887 7348 m 9887 7348 l pc 80 | gr 81 | gs 82 | 34.99111 lw 1 lj 0.003 0.003 0.003 c 17506 14967 m 17506 14967 l pc 83 | gr 84 | pum 85 | 12096 8506 t 86 | 0.003 0.003 0.003 c 17 0 m 17 -20 l 62 -20 l 62 -270 l 17 -270 l 17 -290 l 87 | 177 -290 l 216 -290 247 -283 269 -268 ct 292 -253 303 -234 303 -212 ct 303 -197 297 -184 286 -171 ct 88 | 274 -159 256 -150 233 -144 ct 260 -134 276 -117 280 -94 ct 280 -94 281 -88 282 -77 ct 89 | 284 -66 284 -60 285 -58 ct 286 -52 286 -47 287 -43 ct 288 -39 290 -34 292 -28 ct 90 | 294 -22 297 -18 301 -15 ct 305 -12 310 -10 316 -10 ct 323 -10 329 -13 334 -18 ct 91 | 339 -23 342 -30 343 -40 ct 343 -42 344 -44 344 -45 ct 344 -46 345 -47 346 -48 ct 92 | 348 -49 350 -49 353 -49 ct 360 -49 363 -46 363 -40 ct 363 -38 363 -36 362 -33 ct 93 | 362 -30 360 -26 358 -21 ct 356 -17 353 -13 350 -9 ct 346 -5 341 -2 335 1 ct 328 4 321 5 312 5 ct 94 | 285 5 265 1 250 -6 ct 243 -9 237 -13 233 -18 ct 229 -22 226 -27 224 -33 ct 223 -39 221 -45 221 -49 ct 95 | 221 -54 220 -60 220 -69 ct 220 -86 220 -98 218 -104 ct 217 -110 213 -116 207 -123 ct 96 | 198 -133 186 -138 169 -138 ct 120 -138 l 120 -20 l 165 -20 l 165 0 l 155 -1 130 -1 91 -1 ct 97 | 51 -1 27 -1 17 0 ct p 98 | 120 -153 m 169 -153 l 182 -153 193 -154 203 -157 ct 212 -160 219 -163 224 -166 ct 99 | 228 -170 232 -175 234 -181 ct 237 -187 238 -192 238 -196 ct 238 -200 239 -205 239 -212 ct 100 | 239 -218 238 -224 238 -228 ct 238 -232 236 -237 234 -243 ct 231 -249 228 -254 223 -257 ct 101 | 219 -260 212 -263 203 -266 ct 194 -269 183 -270 170 -270 ct 120 -270 l 120 -153 l 102 | p ef 103 | 378 -45 m 378 -86 423 -108 515 -112 ct 515 -126 l 515 -159 500 -176 468 -176 ct 104 | 457 -176 447 -175 438 -173 ct 444 -169 447 -162 447 -152 ct 447 -144 445 -137 439 -133 ct 105 | 434 -128 428 -126 421 -126 ct 414 -126 408 -128 403 -133 ct 397 -137 394 -144 394 -152 ct 106 | 394 -178 420 -191 470 -191 ct 501 -191 524 -185 540 -174 ct 555 -162 563 -146 563 -126 ct 107 | 563 -36 l 563 -32 564 -29 564 -27 ct 565 -25 567 -24 571 -22 ct 575 -21 581 -20 589 -20 ct 108 | 592 -20 593 -20 595 -20 ct 596 -19 597 -18 598 -17 ct 599 -16 600 -13 600 -10 ct 109 | 600 -6 599 -3 597 -2 ct 595 -1 592 0 587 0 ct 566 0 l 556 0 547 -1 541 -3 ct 534 -5 530 -8 527 -12 ct 110 | 525 -16 524 -19 523 -22 ct 522 -24 522 -28 522 -33 ct 510 -9 489 3 459 3 ct 451 3 442 2 434 1 ct 111 | 425 0 417 -2 408 -6 ct 399 -9 391 -14 386 -21 ct 380 -28 378 -36 378 -45 ct p 112 | 427 -46 m 427 -36 431 -29 438 -22 ct 446 -16 455 -12 466 -12 ct 469 -12 473 -13 478 -14 ct 113 | 483 -15 488 -17 494 -20 ct 500 -23 505 -27 509 -34 ct 513 -41 515 -49 515 -58 ct 114 | 515 -98 l 509 -98 503 -98 497 -97 ct 492 -97 485 -95 475 -93 ct 466 -90 458 -87 452 -84 ct 115 | 445 -81 439 -76 434 -69 ct 430 -62 427 -55 427 -46 ct p ef 116 | 620 0 m 620 -20 l 649 -20 l 649 -150 l 649 -158 648 -163 645 -165 ct 117 | 642 -166 634 -167 620 -167 ct 620 -187 l 693 -190 l 693 -144 l 708 -175 733 -190 767 -190 ct 118 | 789 -190 805 -186 816 -176 ct 827 -167 832 -151 832 -129 ct 832 -20 l 861 -20 l 119 | 861 0 l 837 0 820 0 808 0 ct 796 0 778 0 755 0 ct 755 -20 l 784 -20 l 784 -134 l 120 | 784 -149 782 -160 778 -166 ct 774 -172 768 -175 760 -175 ct 745 -175 731 -169 717 -157 ct 121 | 704 -146 697 -129 697 -108 ct 697 -20 l 727 -20 l 727 0 l 703 0 685 0 673 0 ct 122 | 661 0 644 0 620 0 ct p ef 123 | 888 -93 m 888 -123 898 -146 918 -164 ct 937 -181 963 -190 994 -190 ct 1016 -190 1035 -184 1051 -171 ct 124 | 1051 -254 l 1051 -262 1050 -267 1047 -268 ct 1044 -270 1036 -271 1022 -271 ct 125 | 1022 -290 l 1097 -294 l 1097 -36 l 1097 -28 1099 -23 1101 -22 ct 1104 -20 1113 -19 1126 -19 ct 126 | 1126 0 l 1049 3 l 1049 -18 l 1032 -4 1012 3 990 3 ct 959 3 934 -6 916 -24 ct 127 | 897 -42 888 -65 888 -93 ct p 128 | 942 -93 m 942 -86 942 -81 942 -76 ct 943 -72 943 -67 944 -59 ct 945 -52 946 -46 949 -41 ct 129 | 951 -37 954 -32 957 -27 ct 961 -22 966 -18 972 -16 ct 978 -13 986 -12 994 -12 ct 130 | 1016 -12 1034 -23 1049 -43 ct 1049 -149 l 1036 -166 1019 -175 998 -175 ct 978 -175 963 -168 953 -153 ct 131 | 946 -142 942 -122 942 -93 ct p ef 132 | 1157 -92 m 1157 -121 1166 -145 1185 -163 ct 1204 -182 1231 -191 1264 -191 ct 133 | 1298 -191 1324 -182 1344 -163 ct 1363 -145 1372 -121 1372 -92 ct 1372 -64 1363 -42 1344 -24 ct 134 | 1325 -6 1299 3 1264 3 ct 1230 3 1204 -6 1185 -24 ct 1166 -42 1157 -64 1157 -92 ct 135 | p 136 | 1211 -96 m 1211 -88 1211 -82 1211 -77 ct 1211 -73 1212 -67 1213 -59 ct 1214 -51 1215 -45 1217 -41 ct 137 | 1220 -37 1223 -32 1227 -27 ct 1230 -23 1235 -19 1242 -17 ct 1248 -15 1256 -14 1264 -14 ct 138 | 1273 -14 1281 -15 1287 -17 ct 1293 -19 1298 -23 1302 -27 ct 1306 -32 1309 -37 1311 -41 ct 139 | 1314 -45 1315 -51 1316 -59 ct 1317 -67 1318 -73 1318 -77 ct 1318 -82 1318 -88 1318 -96 ct 140 | 1318 -126 1315 -145 1309 -154 ct 1300 -169 1285 -176 1264 -176 ct 1242 -176 1226 -168 1218 -151 ct 141 | 1213 -142 1211 -124 1211 -96 ct p ef 142 | 1408 0 m 1408 -20 l 1437 -20 l 1437 -150 l 1437 -158 1436 -163 1433 -165 ct 143 | 1430 -166 1422 -167 1408 -167 ct 1408 -187 l 1481 -190 l 1481 -144 l 1496 -175 1521 -190 1555 -190 ct 144 | 1592 -190 1613 -177 1619 -150 ct 1634 -177 1658 -190 1690 -190 ct 1712 -190 1729 -185 1739 -176 ct 145 | 1750 -166 1755 -151 1755 -129 ct 1755 -20 l 1785 -20 l 1785 0 l 1761 0 1743 0 1731 0 ct 146 | 1719 0 1702 0 1678 0 ct 1678 -20 l 1707 -20 l 1707 -134 l 1707 -149 1705 -160 1701 -166 ct 147 | 1697 -172 1691 -175 1683 -175 ct 1668 -175 1654 -169 1640 -157 ct 1627 -146 1620 -129 1620 -108 ct 148 | 1620 -20 l 1650 -20 l 1650 0 l 1626 0 1608 0 1596 0 ct 1584 0 1567 0 1543 0 ct 149 | 1543 -20 l 1572 -20 l 1572 -134 l 1572 -149 1570 -160 1566 -166 ct 1562 -172 1556 -175 1548 -175 ct 150 | 1533 -175 1519 -169 1506 -157 ct 1492 -146 1485 -129 1485 -108 ct 1485 -20 l 151 | 1515 -20 l 1515 0 l 1491 0 1473 0 1461 0 ct 1449 0 1432 0 1408 0 ct p ef 152 | 1812 0 m 1812 -20 l 1821 -20 l 1836 -20 1845 -20 1849 -22 ct 1853 -23 1856 -26 1857 -29 ct 153 | 1962 -284 l 1963 -288 1964 -290 1965 -291 ct 1966 -292 1967 -293 1969 -294 ct 154 | 1972 -295 1975 -296 1979 -296 ct 1982 -296 1984 -295 1985 -295 ct 1987 -295 1988 -294 1990 -292 ct 155 | 1992 -290 1994 -288 1996 -284 ct 2104 -20 l 2145 -20 l 2145 0 l 2135 -1 2112 -1 2076 -1 ct 156 | 2037 -1 2012 -1 2001 0 ct 2001 -20 l 2042 -20 l 2016 -81 l 1903 -81 l 157 | 1882 -30 l 1881 -29 1880 -27 1880 -25 ct 1880 -21 1893 -20 1918 -20 ct 1918 0 l 158 | 1907 0 1889 0 1862 0 ct 1861 0 1844 0 1812 0 ct p 159 | 1911 -101 m 2008 -101 l 1960 -219 l 1911 -101 l p ef 160 | 2166 -94 m 2166 -121 2175 -144 2193 -163 ct 2211 -182 2238 -192 2273 -192 ct 161 | 2322 -192 2347 -179 2347 -153 ct 2347 -144 2344 -138 2339 -133 ct 2333 -128 2327 -126 2320 -126 ct 162 | 2314 -126 2308 -128 2302 -133 ct 2297 -138 2294 -144 2294 -153 ct 2294 -161 2297 -167 2302 -172 ct 163 | 2295 -174 2286 -175 2275 -175 ct 2264 -175 2255 -173 2248 -169 ct 2241 -164 2235 -160 2232 -154 ct 164 | 2228 -149 2226 -142 2224 -134 ct 2222 -125 2221 -118 2221 -114 ct 2220 -109 2220 -103 2220 -96 ct 165 | 2220 -41 2240 -14 2279 -14 ct 2305 -14 2322 -26 2332 -49 ct 2333 -52 2334 -53 2335 -54 ct 166 | 2336 -55 2338 -55 2342 -55 ct 2349 -55 2352 -53 2352 -49 ct 2352 -48 2352 -46 2351 -43 ct 167 | 2349 -39 2347 -35 2343 -30 ct 2340 -24 2335 -19 2329 -15 ct 2324 -10 2316 -6 2305 -2 ct 168 | 2295 1 2284 3 2271 3 ct 2239 3 2213 -6 2194 -24 ct 2176 -42 2166 -65 2166 -94 ct 169 | p ef 170 | 2381 -94 m 2381 -121 2390 -144 2408 -163 ct 2426 -182 2453 -192 2488 -192 ct 171 | 2537 -192 2562 -179 2562 -153 ct 2562 -144 2559 -138 2554 -133 ct 2548 -128 2542 -126 2535 -126 ct 172 | 2529 -126 2523 -128 2517 -133 ct 2512 -138 2509 -144 2509 -153 ct 2509 -161 2512 -167 2517 -172 ct 173 | 2510 -174 2501 -175 2490 -175 ct 2479 -175 2470 -173 2463 -169 ct 2456 -164 2450 -160 2447 -154 ct 174 | 2443 -149 2441 -142 2439 -134 ct 2437 -125 2436 -118 2436 -114 ct 2435 -109 2435 -103 2435 -96 ct 175 | 2435 -41 2455 -14 2494 -14 ct 2520 -14 2537 -26 2547 -49 ct 2548 -52 2549 -53 2550 -54 ct 176 | 2551 -55 2553 -55 2557 -55 ct 2564 -55 2567 -53 2567 -49 ct 2567 -48 2567 -46 2566 -43 ct 177 | 2564 -39 2562 -35 2558 -30 ct 2555 -24 2550 -19 2544 -15 ct 2539 -10 2531 -6 2520 -2 ct 178 | 2510 1 2499 3 2486 3 ct 2454 3 2428 -6 2409 -24 ct 2391 -42 2381 -65 2381 -94 ct 179 | p ef 180 | 2595 -95 m 2595 -122 2604 -145 2622 -164 ct 2641 -182 2666 -191 2699 -191 ct 181 | 2728 -191 2750 -184 2766 -168 ct 2782 -153 2790 -131 2790 -103 ct 2790 -98 2789 -95 2787 -94 ct 182 | 2785 -93 2782 -92 2776 -92 ct 2649 -92 l 2649 -40 2669 -14 2709 -14 ct 2723 -14 2735 -17 2746 -23 ct 183 | 2757 -30 2765 -38 2769 -48 ct 2771 -52 2772 -54 2773 -55 ct 2774 -56 2776 -57 2780 -57 ct 184 | 2787 -57 2790 -54 2790 -49 ct 2790 -47 2789 -44 2788 -41 ct 2786 -37 2783 -33 2779 -28 ct 185 | 2775 -23 2770 -18 2764 -13 ct 2758 -9 2750 -5 2739 -2 ct 2729 1 2718 3 2705 3 ct 186 | 2671 3 2645 -6 2625 -24 ct 2605 -43 2595 -66 2595 -95 ct p 187 | 2649 -106 m 2750 -106 l 2748 -153 2731 -176 2699 -176 ct 2682 -176 2668 -169 2659 -154 ct 188 | 2653 -145 2650 -129 2649 -106 ct p ef 189 | 2822 -9 m 2822 -55 l 2822 -60 2823 -64 2824 -65 ct 2825 -67 2827 -67 2832 -67 ct 190 | 2836 -67 2838 -67 2839 -67 ct 2840 -66 2842 -64 2842 -61 ct 2844 -56 2846 -50 2848 -46 ct 191 | 2850 -41 2853 -36 2858 -30 ct 2862 -24 2868 -20 2876 -17 ct 2884 -14 2893 -12 2903 -12 ct 192 | 2935 -12 2952 -23 2952 -44 ct 2952 -50 2950 -55 2947 -59 ct 2944 -64 2939 -67 2933 -69 ct 193 | 2927 -72 2923 -73 2919 -74 ct 2915 -75 2910 -76 2905 -77 ct 2891 -80 2881 -82 2876 -83 ct 194 | 2870 -84 2864 -86 2857 -89 ct 2850 -92 2844 -96 2839 -100 ct 2828 -110 2822 -122 2822 -136 ct 195 | 2822 -145 2824 -153 2827 -159 ct 2830 -166 2834 -171 2840 -175 ct 2845 -179 2851 -182 2856 -185 ct 196 | 2861 -187 2867 -189 2874 -190 ct 2881 -190 2886 -191 2890 -191 ct 2893 -192 2896 -192 2900 -192 ct 197 | 2918 -192 2932 -189 2943 -184 ct 2954 -189 2960 -192 2962 -192 ct 2965 -192 2967 -191 2968 -189 ct 198 | 2969 -188 2969 -185 2969 -180 ct 2969 -146 l 2969 -141 2969 -137 2968 -136 ct 199 | 2967 -135 2964 -134 2959 -134 ct 2955 -134 2952 -135 2951 -136 ct 2950 -137 2950 -139 2949 -142 ct 200 | 2947 -166 2931 -178 2899 -178 ct 2868 -178 2852 -169 2852 -152 ct 2852 -147 2853 -143 2856 -139 ct 201 | 2859 -136 2863 -133 2868 -131 ct 2874 -129 2878 -128 2881 -127 ct 2884 -126 2889 -125 2895 -124 ct 202 | 2914 -121 2927 -118 2935 -116 ct 2943 -114 2951 -110 2958 -104 ct 2974 -91 2982 -76 2982 -59 ct 203 | 2982 -49 2980 -40 2977 -33 ct 2974 -25 2969 -19 2964 -15 ct 2958 -11 2953 -8 2948 -5 ct 204 | 2942 -2 2936 0 2929 1 ct 2922 2 2917 2 2914 3 ct 2911 3 2907 3 2903 3 ct 2883 3 2866 -2 2853 -11 ct 205 | 2842 -3 l 2836 1 2832 3 2830 3 ct 2826 3 2824 2 2823 0 ct 2823 -1 2822 -4 2822 -9 ct 206 | p ef 207 | 3012 -9 m 3012 -55 l 3012 -60 3013 -64 3014 -65 ct 3015 -67 3017 -67 3022 -67 ct 208 | 3026 -67 3028 -67 3029 -67 ct 3030 -66 3032 -64 3032 -61 ct 3034 -56 3036 -50 3038 -46 ct 209 | 3040 -41 3043 -36 3048 -30 ct 3052 -24 3058 -20 3066 -17 ct 3074 -14 3083 -12 3093 -12 ct 210 | 3125 -12 3142 -23 3142 -44 ct 3142 -50 3140 -55 3137 -59 ct 3134 -64 3129 -67 3123 -69 ct 211 | 3117 -72 3113 -73 3109 -74 ct 3105 -75 3100 -76 3095 -77 ct 3081 -80 3071 -82 3066 -83 ct 212 | 3060 -84 3054 -86 3047 -89 ct 3040 -92 3034 -96 3029 -100 ct 3018 -110 3012 -122 3012 -136 ct 213 | 3012 -145 3014 -153 3017 -159 ct 3020 -166 3024 -171 3030 -175 ct 3035 -179 3041 -182 3046 -185 ct 214 | 3051 -187 3057 -189 3064 -190 ct 3071 -190 3076 -191 3080 -191 ct 3083 -192 3086 -192 3090 -192 ct 215 | 3108 -192 3122 -189 3133 -184 ct 3144 -189 3150 -192 3152 -192 ct 3155 -192 3157 -191 3158 -189 ct 216 | 3159 -188 3159 -185 3159 -180 ct 3159 -146 l 3159 -141 3159 -137 3158 -136 ct 217 | 3157 -135 3154 -134 3149 -134 ct 3145 -134 3142 -135 3141 -136 ct 3140 -137 3140 -139 3139 -142 ct 218 | 3137 -166 3121 -178 3089 -178 ct 3058 -178 3042 -169 3042 -152 ct 3042 -147 3043 -143 3046 -139 ct 219 | 3049 -136 3053 -133 3058 -131 ct 3064 -129 3068 -128 3071 -127 ct 3074 -126 3079 -125 3085 -124 ct 220 | 3104 -121 3117 -118 3125 -116 ct 3133 -114 3141 -110 3148 -104 ct 3164 -91 3172 -76 3172 -59 ct 221 | 3172 -49 3170 -40 3167 -33 ct 3164 -25 3159 -19 3154 -15 ct 3148 -11 3143 -8 3138 -5 ct 222 | 3132 -2 3126 0 3119 1 ct 3112 2 3107 2 3104 3 ct 3101 3 3097 3 3093 3 ct 3073 3 3056 -2 3043 -11 ct 223 | 3032 -3 l 3026 1 3022 3 3020 3 ct 3016 3 3014 2 3013 0 ct 3013 -1 3012 -4 3012 -9 ct 224 | p ef 225 | pom 226 | gs 227 | 1.000 1.000 1.000 c 13633 8998 m 15252 8998 16490 10235 16490 11855 ct 16490 13475 15252 14712 13633 14712 ct 228 | 12013 14712 10775 13475 10775 11855 ct 10775 10235 12013 8998 13633 8998 ct 229 | p 230 | 10775 8998 m 10775 8998 l p 231 | 16491 14713 m 16491 14713 l p ef 232 | gr 233 | gs 234 | 34.99111 lw 1 lj 13632 8997 m 15252 8997 16489 10235 16489 11854 ct 16489 13474 15252 14712 13632 14712 ct 235 | 12012 14712 10775 13474 10775 11854 ct 10775 10235 12012 8997 13632 8997 ct 236 | pc 237 | gr 238 | gs 239 | 34.99111 lw 1 lj 10775 8997 m 10775 8997 l pc 240 | gr 241 | gs 242 | 34.99111 lw 1 lj 16490 14713 m 16490 14713 l pc 243 | gr 244 | gs 245 | 1.000 1.000 1.000 c 13695 10448 m 14846 10448 15727 11328 15727 12480 ct 246 | 15727 13632 14846 14512 13695 14512 ct 12543 14512 11663 13632 11663 12480 ct 247 | 11663 11328 12543 10448 13695 10448 ct p 248 | 11663 10448 m 11663 10448 l p 249 | 15728 14513 m 15728 14513 l p ef 250 | gr 251 | gs 252 | 34.99111 lw 1 lj 13694 10448 m 14846 10448 15727 11328 15727 12479 ct 15727 13631 14846 14512 13694 14512 ct 253 | 12542 14512 11663 13631 11663 12479 ct 11663 11328 12542 10448 13694 10448 ct 254 | pc 255 | gr 256 | gs 257 | 34.99111 lw 1 lj 11663 10448 m 11663 10448 l pc 258 | gr 259 | gs 260 | 34.99111 lw 1 lj 15728 14513 m 15728 14513 l pc 261 | gr 262 | pum 263 | 12296 10063 t 264 | 17 0 m 17 -20 l 62 -20 l 62 -271 l 17 -271 l 17 -291 l 200 -291 l 265 | 233 -291 258 -284 277 -270 ct 296 -256 305 -239 305 -218 ct 305 -202 299 -187 286 -176 ct 266 | 273 -164 255 -156 232 -152 ct 257 -150 278 -142 294 -129 ct 310 -116 319 -99 319 -79 ct 267 | 319 -57 309 -38 291 -23 ct 272 -8 246 0 213 0 ct 17 0 l p 268 | 118 -20 m 195 -20 l 205 -20 214 -21 221 -24 ct 229 -26 234 -30 238 -34 ct 269 | 242 -39 246 -43 249 -47 ct 251 -52 253 -56 254 -62 ct 255 -67 256 -71 256 -73 ct 270 | 256 -75 256 -77 256 -79 ct 256 -98 252 -114 242 -126 ct 233 -138 219 -144 200 -144 ct 271 | 118 -144 l 118 -20 l p 272 | 118 -159 m 184 -159 l 203 -159 218 -165 229 -176 ct 240 -187 245 -201 245 -218 ct 273 | 245 -224 244 -229 243 -235 ct 241 -240 239 -246 236 -252 ct 233 -257 227 -262 220 -266 ct 274 | 213 -269 205 -271 195 -271 ct 118 -271 l 118 -159 l p ef 275 | 390 -238 m 383 -244 380 -252 380 -261 ct 380 -270 383 -278 390 -284 ct 396 -291 404 -294 413 -294 ct 276 | 422 -294 430 -291 436 -284 ct 443 -278 446 -270 446 -261 ct 446 -252 443 -244 436 -238 ct 277 | 430 -231 422 -228 413 -228 ct 404 -228 396 -231 390 -238 ct p 278 | 367 0 m 367 -20 l 396 -20 l 396 -150 l 396 -158 395 -163 392 -165 ct 279 | 389 -166 381 -167 368 -167 ct 368 -187 l 442 -190 l 442 -20 l 468 -20 l 280 | 468 0 l 438 0 421 0 418 0 ct 410 0 393 0 367 0 ct p ef 281 | 499 -93 m 499 -123 509 -146 529 -164 ct 548 -181 574 -190 605 -190 ct 627 -190 646 -184 662 -171 ct 282 | 662 -254 l 662 -262 661 -267 658 -268 ct 655 -270 647 -271 633 -271 ct 633 -290 l 283 | 708 -294 l 708 -36 l 708 -28 710 -23 712 -22 ct 715 -20 724 -19 737 -19 ct 284 | 737 0 l 660 3 l 660 -18 l 643 -4 623 3 601 3 ct 570 3 545 -6 527 -24 ct 508 -42 499 -65 499 -93 ct 285 | p 286 | 553 -93 m 553 -86 553 -81 553 -76 ct 554 -72 554 -67 555 -59 ct 556 -52 557 -46 560 -41 ct 287 | 562 -37 565 -32 568 -27 ct 572 -22 577 -18 583 -16 ct 589 -13 597 -12 605 -12 ct 288 | 627 -12 645 -23 660 -43 ct 660 -149 l 647 -166 630 -175 609 -175 ct 589 -175 574 -168 564 -153 ct 289 | 557 -142 553 -122 553 -93 ct p ef 290 | 797 -238 m 790 -244 787 -252 787 -261 ct 787 -270 790 -278 797 -284 ct 803 -291 811 -294 820 -294 ct 291 | 829 -294 837 -291 843 -284 ct 850 -278 853 -270 853 -261 ct 853 -252 850 -244 843 -238 ct 292 | 837 -231 829 -228 820 -228 ct 811 -228 803 -231 797 -238 ct p 293 | 774 0 m 774 -20 l 803 -20 l 803 -150 l 803 -158 802 -163 799 -165 ct 294 | 796 -166 788 -167 775 -167 ct 775 -187 l 849 -190 l 849 -20 l 875 -20 l 295 | 875 0 l 845 0 828 0 825 0 ct 817 0 800 0 774 0 ct p ef 296 | 905 0 m 905 -20 l 934 -20 l 934 -150 l 934 -158 932 -163 929 -165 ct 297 | 926 -166 918 -167 905 -167 ct 905 -187 l 975 -190 l 975 -142 l 986 -174 1005 -190 1031 -190 ct 298 | 1043 -190 1053 -187 1062 -181 ct 1071 -175 1076 -166 1076 -156 ct 1076 -148 1073 -141 1068 -137 ct 299 | 1063 -132 1057 -130 1050 -130 ct 1043 -130 1037 -132 1032 -136 ct 1027 -141 1024 -147 1024 -156 ct 300 | 1024 -163 1027 -170 1032 -175 ct 1023 -175 1014 -172 1007 -167 ct 999 -161 994 -154 990 -145 ct 301 | 986 -136 984 -128 982 -119 ct 980 -111 980 -102 980 -94 ct 980 -20 l 1016 -20 l 302 | 1016 0 l 1006 0 987 0 958 0 ct 952 0 934 0 905 0 ct p ef 303 | 1102 -95 m 1102 -122 1111 -145 1129 -164 ct 1148 -182 1173 -191 1206 -191 ct 304 | 1235 -191 1257 -184 1273 -168 ct 1289 -153 1297 -131 1297 -103 ct 1297 -98 1296 -95 1294 -94 ct 305 | 1292 -93 1289 -92 1283 -92 ct 1156 -92 l 1156 -40 1176 -14 1216 -14 ct 1230 -14 1242 -17 1253 -23 ct 306 | 1264 -30 1272 -38 1276 -48 ct 1278 -52 1279 -54 1280 -55 ct 1281 -56 1283 -57 1287 -57 ct 307 | 1294 -57 1297 -54 1297 -49 ct 1297 -47 1296 -44 1295 -41 ct 1293 -37 1290 -33 1286 -28 ct 308 | 1282 -23 1277 -18 1271 -13 ct 1265 -9 1257 -5 1246 -2 ct 1236 1 1225 3 1212 3 ct 309 | 1178 3 1152 -6 1132 -24 ct 1112 -43 1102 -66 1102 -95 ct p 310 | 1156 -106 m 1257 -106 l 1255 -153 1238 -176 1206 -176 ct 1189 -176 1175 -169 1166 -154 ct 311 | 1160 -145 1157 -129 1156 -106 ct p ef 312 | 1328 -94 m 1328 -121 1337 -144 1355 -163 ct 1373 -182 1400 -192 1435 -192 ct 313 | 1484 -192 1509 -179 1509 -153 ct 1509 -144 1506 -138 1501 -133 ct 1495 -128 1489 -126 1482 -126 ct 314 | 1476 -126 1470 -128 1464 -133 ct 1459 -138 1456 -144 1456 -153 ct 1456 -161 1459 -167 1464 -172 ct 315 | 1457 -174 1448 -175 1437 -175 ct 1426 -175 1417 -173 1410 -169 ct 1403 -164 1397 -160 1394 -154 ct 316 | 1390 -149 1388 -142 1386 -134 ct 1384 -125 1383 -118 1383 -114 ct 1382 -109 1382 -103 1382 -96 ct 317 | 1382 -41 1402 -14 1441 -14 ct 1467 -14 1484 -26 1494 -49 ct 1495 -52 1496 -53 1497 -54 ct 318 | 1498 -55 1500 -55 1504 -55 ct 1511 -55 1514 -53 1514 -49 ct 1514 -48 1514 -46 1513 -43 ct 319 | 1511 -39 1509 -35 1505 -30 ct 1502 -24 1497 -19 1491 -15 ct 1486 -10 1478 -6 1467 -2 ct 320 | 1457 1 1446 3 1433 3 ct 1401 3 1375 -6 1356 -24 ct 1338 -42 1328 -65 1328 -94 ct 321 | p ef 322 | 1537 -168 m 1537 -184 l 1557 -184 1572 -192 1583 -209 ct 1594 -226 1600 -246 1600 -269 ct 323 | 1620 -269 l 1620 -188 l 1682 -188 l 1682 -168 l 1620 -168 l 1620 -51 l 324 | 1620 -26 1628 -14 1644 -14 ct 1651 -14 1657 -17 1662 -24 ct 1667 -30 1670 -40 1670 -53 ct 325 | 1670 -75 l 1690 -75 l 1690 -52 l 1690 -36 1685 -23 1676 -13 ct 1667 -2 1654 3 1638 3 ct 326 | 1594 3 1572 -15 1572 -52 ct 1572 -168 l 1537 -168 l p ef 327 | 1762 -238 m 1755 -244 1752 -252 1752 -261 ct 1752 -270 1755 -278 1762 -284 ct 328 | 1768 -291 1776 -294 1785 -294 ct 1794 -294 1802 -291 1808 -284 ct 1815 -278 1818 -270 1818 -261 ct 329 | 1818 -252 1815 -244 1808 -238 ct 1802 -231 1794 -228 1785 -228 ct 1776 -228 1768 -231 1762 -238 ct 330 | p 331 | 1739 0 m 1739 -20 l 1768 -20 l 1768 -150 l 1768 -158 1767 -163 1764 -165 ct 332 | 1761 -166 1753 -167 1740 -167 ct 1740 -187 l 1814 -190 l 1814 -20 l 1840 -20 l 333 | 1840 0 l 1810 0 1793 0 1790 0 ct 1782 0 1765 0 1739 0 ct p ef 334 | 1868 -92 m 1868 -121 1877 -145 1896 -163 ct 1915 -182 1942 -191 1975 -191 ct 335 | 2009 -191 2035 -182 2055 -163 ct 2074 -145 2083 -121 2083 -92 ct 2083 -64 2074 -42 2055 -24 ct 336 | 2036 -6 2010 3 1975 3 ct 1941 3 1915 -6 1896 -24 ct 1877 -42 1868 -64 1868 -92 ct 337 | p 338 | 1922 -96 m 1922 -88 1922 -82 1922 -77 ct 1922 -73 1923 -67 1924 -59 ct 1925 -51 1926 -45 1928 -41 ct 339 | 1931 -37 1934 -32 1938 -27 ct 1941 -23 1946 -19 1953 -17 ct 1959 -15 1967 -14 1975 -14 ct 340 | 1984 -14 1992 -15 1998 -17 ct 2004 -19 2009 -23 2013 -27 ct 2017 -32 2020 -37 2022 -41 ct 341 | 2025 -45 2026 -51 2027 -59 ct 2028 -67 2029 -73 2029 -77 ct 2029 -82 2029 -88 2029 -96 ct 342 | 2029 -126 2026 -145 2020 -154 ct 2011 -169 1996 -176 1975 -176 ct 1953 -176 1937 -168 1929 -151 ct 343 | 1924 -142 1922 -124 1922 -96 ct p ef 344 | 2118 0 m 2118 -20 l 2147 -20 l 2147 -150 l 2147 -158 2146 -163 2143 -165 ct 345 | 2140 -166 2132 -167 2118 -167 ct 2118 -187 l 2191 -190 l 2191 -144 l 2206 -175 2231 -190 2265 -190 ct 346 | 2287 -190 2303 -186 2314 -176 ct 2325 -167 2330 -151 2330 -129 ct 2330 -20 l 347 | 2359 -20 l 2359 0 l 2335 0 2318 0 2306 0 ct 2294 0 2276 0 2253 0 ct 2253 -20 l 348 | 2282 -20 l 2282 -134 l 2282 -149 2280 -160 2276 -166 ct 2272 -172 2266 -175 2258 -175 ct 349 | 2243 -175 2229 -169 2215 -157 ct 2202 -146 2195 -129 2195 -108 ct 2195 -20 l 350 | 2225 -20 l 2225 0 l 2201 0 2183 0 2171 0 ct 2159 0 2142 0 2118 0 ct p ef 351 | 2384 -45 m 2384 -86 2429 -108 2521 -112 ct 2521 -126 l 2521 -159 2506 -176 2474 -176 ct 352 | 2463 -176 2453 -175 2444 -173 ct 2450 -169 2453 -162 2453 -152 ct 2453 -144 2451 -137 2445 -133 ct 353 | 2440 -128 2434 -126 2427 -126 ct 2420 -126 2414 -128 2409 -133 ct 2403 -137 2400 -144 2400 -152 ct 354 | 2400 -178 2426 -191 2476 -191 ct 2507 -191 2530 -185 2546 -174 ct 2561 -162 2569 -146 2569 -126 ct 355 | 2569 -36 l 2569 -32 2570 -29 2570 -27 ct 2571 -25 2573 -24 2577 -22 ct 2581 -21 2587 -20 2595 -20 ct 356 | 2598 -20 2599 -20 2601 -20 ct 2602 -19 2603 -18 2604 -17 ct 2605 -16 2606 -13 2606 -10 ct 357 | 2606 -6 2605 -3 2603 -2 ct 2601 -1 2598 0 2593 0 ct 2572 0 l 2562 0 2553 -1 2547 -3 ct 358 | 2540 -5 2536 -8 2533 -12 ct 2531 -16 2530 -19 2529 -22 ct 2528 -24 2528 -28 2528 -33 ct 359 | 2516 -9 2495 3 2465 3 ct 2457 3 2448 2 2440 1 ct 2431 0 2423 -2 2414 -6 ct 2405 -9 2397 -14 2392 -21 ct 360 | 2386 -28 2384 -36 2384 -45 ct p 361 | 2433 -46 m 2433 -36 2437 -29 2444 -22 ct 2452 -16 2461 -12 2472 -12 ct 2475 -12 2479 -13 2484 -14 ct 362 | 2489 -15 2494 -17 2500 -20 ct 2506 -23 2511 -27 2515 -34 ct 2519 -41 2521 -49 2521 -58 ct 363 | 2521 -98 l 2515 -98 2509 -98 2503 -97 ct 2498 -97 2491 -95 2481 -93 ct 2472 -90 2464 -87 2458 -84 ct 364 | 2451 -81 2445 -76 2440 -69 ct 2436 -62 2433 -55 2433 -46 ct p ef 365 | 2627 0 m 2627 -20 l 2656 -20 l 2656 -254 l 2656 -262 2655 -267 2652 -268 ct 366 | 2649 -270 2640 -271 2627 -271 ct 2627 -290 l 2702 -294 l 2702 -20 l 2731 -20 l 367 | 2731 0 l 2702 0 2685 0 2679 0 ct 2671 0 2654 0 2627 0 ct p ef 368 | pom 369 | pum 370 | 12797 12664 t 371 | 17 0 m 17 -20 l 62 -20 l 62 -268 l 17 -268 l 17 -288 l 272 -288 l 372 | 286 -185 l 266 -185 l 264 -197 263 -206 261 -213 ct 259 -221 257 -228 253 -236 ct 373 | 249 -243 245 -249 239 -254 ct 233 -258 225 -261 216 -264 ct 206 -267 195 -268 181 -268 ct 374 | 122 -268 l 122 -154 l 143 -154 l 162 -154 174 -158 180 -165 ct 185 -173 188 -185 188 -203 ct 375 | 208 -203 l 208 -84 l 188 -84 l 188 -102 185 -115 180 -122 ct 174 -130 162 -134 143 -134 ct 376 | 122 -134 l 122 -20 l 179 -20 l 179 0 l 167 0 138 0 94 0 ct 53 0 27 0 17 0 ct 377 | p ef 378 | 281 -92 m 281 -121 290 -145 309 -163 ct 328 -182 355 -191 388 -191 ct 422 -191 448 -182 468 -163 ct 379 | 487 -145 496 -121 496 -92 ct 496 -64 487 -42 468 -24 ct 449 -6 423 3 388 3 ct 354 3 328 -6 309 -24 ct 380 | 290 -42 281 -64 281 -92 ct p 381 | 335 -96 m 335 -88 335 -82 335 -77 ct 335 -73 336 -67 337 -59 ct 338 -51 339 -45 341 -41 ct 382 | 344 -37 347 -32 351 -27 ct 354 -23 359 -19 366 -17 ct 372 -15 380 -14 388 -14 ct 383 | 397 -14 405 -15 411 -17 ct 417 -19 422 -23 426 -27 ct 430 -32 433 -37 435 -41 ct 384 | 438 -45 439 -51 440 -59 ct 441 -67 442 -73 442 -77 ct 442 -82 442 -88 442 -96 ct 385 | 442 -126 439 -145 433 -154 ct 424 -169 409 -176 388 -176 ct 366 -176 350 -168 342 -151 ct 386 | 337 -142 335 -124 335 -96 ct p ef 387 | 528 0 m 528 -20 l 557 -20 l 557 -150 l 557 -158 555 -163 552 -165 ct 388 | 549 -166 541 -167 528 -167 ct 528 -187 l 598 -190 l 598 -142 l 609 -174 628 -190 654 -190 ct 389 | 666 -190 676 -187 685 -181 ct 694 -175 699 -166 699 -156 ct 699 -148 696 -141 691 -137 ct 390 | 686 -132 680 -130 673 -130 ct 666 -130 660 -132 655 -136 ct 650 -141 647 -147 647 -156 ct 391 | 647 -163 650 -170 655 -175 ct 646 -175 637 -172 630 -167 ct 622 -161 617 -154 613 -145 ct 392 | 609 -136 607 -128 605 -119 ct 603 -111 603 -102 603 -94 ct 603 -20 l 639 -20 l 393 | 639 0 l 629 0 610 0 581 0 ct 575 0 557 0 528 0 ct p ef 394 | 722 -168 m 722 -187 l 750 -187 766 -187 768 -187 ct 785 -187 803 -187 820 -187 ct 395 | 820 -168 l 796 -168 l 840 -59 l 874 -140 l 875 -143 876 -145 876 -146 ct 396 | 876 -146 873 -154 867 -168 ct 842 -168 l 842 -187 l 855 -187 869 -187 884 -187 ct 397 | 889 -187 905 -187 932 -187 ct 932 -168 l 909 -168 l 957 -49 l 1001 -158 l 398 | 1001 -158 1001 -159 1002 -159 ct 1002 -160 1003 -161 1003 -161 ct 1003 -162 1003 -163 1003 -163 ct 399 | 1003 -166 995 -168 978 -168 ct 978 -187 l 997 -187 1010 -187 1019 -187 ct 1031 -187 1042 -187 1052 -188 ct 400 | 1052 -168 l 1044 -168 1038 -168 1034 -167 ct 1029 -166 1027 -165 1026 -164 ct 401 | 1025 -163 1024 -161 1023 -159 ct 962 -9 l 961 -6 960 -4 959 -3 ct 958 -2 957 0 955 1 ct 402 | 953 1 950 2 947 2 ct 942 2 939 1 937 -1 ct 935 -2 933 -5 931 -9 ct 887 -119 l 842 -9 l 403 | 841 -6 840 -4 839 -3 ct 838 -2 837 0 835 1 ct 833 1 830 2 826 2 ct 822 2 818 1 817 -1 ct 404 | 815 -2 813 -5 811 -9 ct 747 -168 l 722 -168 l p ef 405 | 1064 -45 m 1064 -86 1109 -108 1201 -112 ct 1201 -126 l 1201 -159 1186 -176 1154 -176 ct 406 | 1143 -176 1133 -175 1124 -173 ct 1130 -169 1133 -162 1133 -152 ct 1133 -144 1131 -137 1125 -133 ct 407 | 1120 -128 1114 -126 1107 -126 ct 1100 -126 1094 -128 1089 -133 ct 1083 -137 1080 -144 1080 -152 ct 408 | 1080 -178 1106 -191 1156 -191 ct 1187 -191 1210 -185 1226 -174 ct 1241 -162 1249 -146 1249 -126 ct 409 | 1249 -36 l 1249 -32 1250 -29 1250 -27 ct 1251 -25 1253 -24 1257 -22 ct 1261 -21 1267 -20 1275 -20 ct 410 | 1278 -20 1279 -20 1281 -20 ct 1282 -19 1283 -18 1284 -17 ct 1285 -16 1286 -13 1286 -10 ct 411 | 1286 -6 1285 -3 1283 -2 ct 1281 -1 1278 0 1273 0 ct 1252 0 l 1242 0 1233 -1 1227 -3 ct 412 | 1220 -5 1216 -8 1213 -12 ct 1211 -16 1210 -19 1209 -22 ct 1208 -24 1208 -28 1208 -33 ct 413 | 1196 -9 1175 3 1145 3 ct 1137 3 1128 2 1120 1 ct 1111 0 1103 -2 1094 -6 ct 1085 -9 1077 -14 1072 -21 ct 414 | 1066 -28 1064 -36 1064 -45 ct p 415 | 1113 -46 m 1113 -36 1117 -29 1124 -22 ct 1132 -16 1141 -12 1152 -12 ct 1155 -12 1159 -13 1164 -14 ct 416 | 1169 -15 1174 -17 1180 -20 ct 1186 -23 1191 -27 1195 -34 ct 1199 -41 1201 -49 1201 -58 ct 417 | 1201 -98 l 1195 -98 1189 -98 1183 -97 ct 1178 -97 1171 -95 1161 -93 ct 1152 -90 1144 -87 1138 -84 ct 418 | 1131 -81 1125 -76 1120 -69 ct 1116 -62 1113 -55 1113 -46 ct p ef 419 | 1303 0 m 1303 -20 l 1332 -20 l 1332 -150 l 1332 -158 1330 -163 1327 -165 ct 420 | 1324 -166 1316 -167 1303 -167 ct 1303 -187 l 1373 -190 l 1373 -142 l 1384 -174 1403 -190 1429 -190 ct 421 | 1441 -190 1451 -187 1460 -181 ct 1469 -175 1474 -166 1474 -156 ct 1474 -148 1471 -141 1466 -137 ct 422 | 1461 -132 1455 -130 1448 -130 ct 1441 -130 1435 -132 1430 -136 ct 1425 -141 1422 -147 1422 -156 ct 423 | 1422 -163 1425 -170 1430 -175 ct 1421 -175 1412 -172 1405 -167 ct 1397 -161 1392 -154 1388 -145 ct 424 | 1384 -136 1382 -128 1380 -119 ct 1378 -111 1378 -102 1378 -94 ct 1378 -20 l 425 | 1414 -20 l 1414 0 l 1404 0 1385 0 1356 0 ct 1350 0 1332 0 1303 0 ct p ef 426 | 1502 -93 m 1502 -123 1512 -146 1532 -164 ct 1551 -181 1577 -190 1608 -190 ct 427 | 1630 -190 1649 -184 1665 -171 ct 1665 -254 l 1665 -262 1664 -267 1661 -268 ct 428 | 1658 -270 1650 -271 1636 -271 ct 1636 -290 l 1711 -294 l 1711 -36 l 1711 -28 1713 -23 1715 -22 ct 429 | 1718 -20 1727 -19 1740 -19 ct 1740 0 l 1663 3 l 1663 -18 l 1646 -4 1626 3 1604 3 ct 430 | 1573 3 1548 -6 1530 -24 ct 1511 -42 1502 -65 1502 -93 ct p 431 | 1556 -93 m 1556 -86 1556 -81 1556 -76 ct 1557 -72 1557 -67 1558 -59 ct 1559 -52 1560 -46 1563 -41 ct 432 | 1565 -37 1568 -32 1571 -27 ct 1575 -22 1580 -18 1586 -16 ct 1592 -13 1600 -12 1608 -12 ct 433 | 1630 -12 1648 -23 1663 -43 ct 1663 -149 l 1650 -166 1633 -175 1612 -175 ct 434 | 1592 -175 1577 -168 1567 -153 ct 1560 -142 1556 -122 1556 -93 ct p ef 435 | pom 436 | 0 7875 t 437 | pom 438 | count op_count sub {pop} repeat countdictstack dict_count sub {end} repeat b4_inc_state restore 439 | %%PageTrailer 440 | %%Trailer 441 | %%EOF 442 | -------------------------------------------------------------------------------- /slides/figures/logical.eps: -------------------------------------------------------------------------------- 1 | %!PS-Adobe-3.0 EPSF-3.0 2 | %%BoundingBox: 0 0 195 239 3 | %%Pages: 0 4 | %%Creator: LibreOffice 6.0 5 | %%Title: none 6 | %%CreationDate: none 7 | %%LanguageLevel: 2 8 | %%EndComments 9 | %%BeginProlog 10 | %%BeginResource: procset SDRes-Prolog 1.0 0 11 | /b4_inc_state save def 12 | /dict_count countdictstack def 13 | /op_count count 1 sub def 14 | userdict begin 15 | 0 setgray 0 setlinecap 1 setlinewidth 0 setlinejoin 10 setmiterlimit[] 0 setdash newpath 16 | /languagelevel where {pop languagelevel 1 ne {false setstrokeadjust false setoverprint} if} if 17 | /bdef {bind def} bind def 18 | /c {setrgbcolor} bdef 19 | /l {neg lineto} bdef 20 | /rl {neg rlineto} bdef 21 | /lc {setlinecap} bdef 22 | /lj {setlinejoin} bdef 23 | /lw {setlinewidth} bdef 24 | /ml {setmiterlimit} bdef 25 | /ld {setdash} bdef 26 | /m {neg moveto} bdef 27 | /ct {6 2 roll neg 6 2 roll neg 6 2 roll neg curveto} bdef 28 | /r {rotate} bdef 29 | /t {neg translate} bdef 30 | /s {scale} bdef 31 | /sw {show} bdef 32 | /gs {gsave} bdef 33 | /gr {grestore} bdef 34 | /f {findfont dup length dict begin 35 | {1 index /FID ne {def} {pop pop} ifelse} forall /Encoding ISOLatin1Encoding def 36 | currentdict end /NFont exch definefont pop /NFont findfont} bdef 37 | /p {closepath} bdef 38 | /sf {scalefont setfont} bdef 39 | /ef {eofill}bdef 40 | /pc {closepath stroke}bdef 41 | /ps {stroke}bdef 42 | /pum {matrix currentmatrix}bdef 43 | /pom {setmatrix}bdef 44 | /bs {/aString exch def /nXOfs exch def /nWidth exch def currentpoint nXOfs 0 rmoveto pum nWidth aString stringwidth pop div 1 scale aString show pom moveto} bdef 45 | %%EndResource 46 | %%EndProlog 47 | %%BeginSetup 48 | %%EndSetup 49 | %%Page: 1 1 50 | %%BeginPageSetup 51 | %%EndPageSetup 52 | pum 53 | 0.02828 0.02839 s 54 | 0 -8417 t 55 | /tm matrix currentmatrix def 56 | tm setmatrix 57 | -17741 -6188 t 58 | 1 1 s 59 | gs 60 | 1.000 1.000 1.000 c 21187 14586 m 17759 14586 l 17759 6206 l 24615 6206 l 61 | 24615 14586 l 21187 14586 l p ef 62 | gr 63 | gs 64 | 34.99076 lw 1 lj 1.000 1.000 1.000 c 21186 14585 m 17758 14585 l 17758 6205 l 65 | 24614 6205 l 24614 14585 l 21186 14585 l pc 66 | gr 67 | gs 68 | 0.800 0.800 0.800 c 21530 7521 m 21625 7752 21678 8009 21678 8281 ct 21678 8553 21625 8810 21530 9041 ct 69 | 21441 9259 21313 9455 21154 9621 ct 20996 9455 20868 9259 20779 9041 ct 20684 8810 20632 8553 20632 8281 ct 70 | 20632 8009 20684 7752 20779 7521 ct 20868 7303 20996 7108 21154 6942 ct 21313 7108 21441 7303 21530 7521 ct 71 | p ef 72 | gr 73 | gs 74 | 0.800 0.800 0.800 c 20514 10705 m 20746 10800 20952 10938 21124 11110 ct 75 | 21134 11120 21144 11130 21154 11141 ct 21164 11130 21174 11120 21184 11110 ct 76 | 21356 10938 21563 10800 21794 10705 ct 22025 10610 22282 10558 22553 10558 ct 77 | 22825 10558 23082 10610 23313 10705 ct 23545 10800 23751 10938 23923 11110 ct 78 | 24096 11282 24234 11489 24329 11720 ct 24424 11951 24477 12208 24477 12480 ct 79 | 24477 12752 24424 13009 24329 13240 ct 24234 13472 24096 13678 23923 13850 ct 80 | 23751 14023 23545 14161 23313 14256 ct 23082 14351 22825 14404 22553 14404 ct 81 | 22282 14404 22025 14351 21794 14256 ct 21563 14161 21356 14023 21184 13850 ct 82 | 21174 13840 21164 13830 21154 13820 ct 21144 13830 21134 13840 21124 13850 ct 83 | 20952 14023 20746 14161 20514 14256 ct 20283 14351 20026 14404 19754 14404 ct 84 | 19482 14404 19225 14351 18994 14256 ct 18764 14161 18557 14023 18385 13850 ct 85 | 18213 13678 18075 13472 17980 13240 ct 17885 13009 17833 12752 17833 12480 ct 86 | 17833 12208 17885 11951 17980 11720 ct 18075 11489 18213 11282 18385 11110 ct 87 | 18557 10938 18764 10800 18994 10705 ct 19225 10610 19482 10558 19754 10558 ct 88 | 20026 10558 20283 10610 20514 10705 ct p ef 89 | gr 90 | gs 91 | 34.99076 lw 1 lj 0.003 0.003 0.003 c 20514 10705 m 20745 10800 20951 10938 21123 11110 ct 92 | 21133 11120 21143 11130 21153 11141 ct 21163 11130 21173 11120 21183 11110 ct 93 | 21355 10938 21562 10800 21793 10705 ct 22024 10610 22281 10558 22553 10558 ct 94 | 22825 10558 23082 10610 23313 10705 ct 23545 10800 23751 10938 23923 11110 ct 95 | 24096 11282 24233 11489 24328 11720 ct 24423 11951 24476 12208 24476 12480 ct 96 | 24476 12751 24423 13008 24328 13239 ct 24233 13471 24096 13677 23923 13849 ct 97 | 23751 14022 23545 14160 23313 14255 ct 23082 14350 22825 14403 22553 14403 ct 98 | 22281 14403 22024 14350 21793 14255 ct 21562 14160 21355 14022 21183 13849 ct 99 | 21173 13839 21163 13829 21153 13819 ct 21143 13829 21133 13839 21123 13849 ct 100 | 20951 14022 20745 14160 20514 14255 ct 20283 14350 20026 14403 19754 14403 ct 101 | 19482 14403 19225 14350 18994 14255 ct 18763 14160 18556 14022 18384 13849 ct 102 | 18212 13677 18074 13471 17979 13239 ct 17884 13008 17832 12751 17832 12480 ct 103 | 17832 12208 17884 11951 17979 11720 ct 18074 11489 18212 11282 18384 11110 ct 104 | 18556 10938 18763 10800 18994 10705 ct 19225 10610 19482 10558 19754 10558 ct 105 | 20026 10558 20283 10610 20514 10705 ct pc 106 | gr 107 | gs 108 | 34.99076 lw 1 lj 0.003 0.003 0.003 c 19754 6376 m 20833 6376 21659 7201 21659 8281 ct 109 | 21659 9360 20833 10186 19754 10186 ct 18674 10186 17849 9360 17849 8281 ct 17849 7201 18674 6376 19754 6376 ct 110 | pc 111 | gr 112 | gs 113 | 34.99076 lw 1 lj 0.003 0.003 0.003 c 17849 6376 m 17849 6376 l pc 114 | gr 115 | gs 116 | 34.99076 lw 1 lj 0.003 0.003 0.003 c 21660 10187 m 21660 10187 l pc 117 | gr 118 | gs 119 | 34.99076 lw 1 lj 0.003 0.003 0.003 c 22553 6376 m 23633 6376 24458 7201 24458 8281 ct 120 | 24458 9360 23633 10186 22553 10186 ct 21473 10186 20649 9360 20649 8281 ct 20649 7201 21473 6376 22553 6376 ct 121 | pc 122 | gr 123 | gs 124 | 34.99076 lw 1 lj 0.003 0.003 0.003 c 20649 6376 m 20649 6376 l pc 125 | gr 126 | gs 127 | 34.99076 lw 1 lj 0.003 0.003 0.003 c 24459 10187 m 24459 10187 l pc 128 | gr 129 | gs 130 | 0.800 0.800 0.800 c 21530 11720 m 21625 11951 21678 12208 21678 12480 ct 131 | 21678 12752 21625 13009 21530 13240 ct 21441 13458 21313 13654 21154 13820 ct 132 | 20996 13654 20868 13458 20779 13240 ct 20684 13009 20632 12752 20632 12480 ct 133 | 20632 12208 20684 11951 20779 11720 ct 20868 11502 20996 11307 21154 11141 ct 134 | 21313 11307 21441 11502 21530 11720 ct p ef 135 | gr 136 | gs 137 | 36 lw 1 lj 0.003 0.003 0.003 c 21530 11720 m 21539 11741 21547 11763 21555 11784 ct 138 | ps 139 | 21578 11849 m 21585 11871 21592 11893 21598 11915 ct ps 140 | 21617 11982 m 21622 12004 21627 12026 21632 12049 ct ps 141 | 21646 12116 m 21650 12139 21653 12162 21657 12185 ct ps 142 | 21665 12253 m 21668 12276 21670 12299 21672 12322 ct ps 143 | 21676 12391 m 21677 12413 21677 12436 21677 12459 ct ps 144 | 21677 12529 m 21676 12552 21676 12575 21674 12597 ct ps 145 | 21669 12666 m 21667 12689 21665 12712 21662 12735 ct ps 146 | 21652 12803 m 21649 12826 21645 12848 21640 12871 ct ps 147 | 21626 12938 m 21621 12961 21615 12983 21610 13005 ct ps 148 | 21591 13072 m 21584 13094 21577 13115 21569 13137 ct ps 149 | 21545 13202 m 21541 13215 21535 13227 21530 13240 ct 21527 13249 21523 13257 21519 13266 ct 150 | ps 151 | 21491 13329 m 21481 13349 21471 13370 21461 13390 ct ps 152 | 21428 13451 m 21416 13471 21405 13491 21393 13510 ct ps 153 | 21356 13568 m 21343 13588 21330 13606 21316 13625 ct ps 154 | 21275 13680 m 21261 13698 21246 13716 21231 13734 ct ps 155 | 21186 13786 m 21176 13797 21165 13809 21154 13820 ct 21149 13814 21144 13809 21139 13804 ct 156 | ps 157 | 21093 13752 m 21078 13735 21063 13717 21049 13699 ct ps 158 | 21007 13645 m 20993 13626 20980 13607 20967 13588 ct ps 159 | 20929 13531 m 20916 13512 20905 13492 20893 13472 ct ps 160 | 20859 13412 m 20849 13392 20838 13371 20828 13350 ct ps 161 | 20799 13288 m 20792 13272 20785 13256 20779 13240 ct 20776 13235 20774 13230 20772 13224 ct 162 | ps 163 | 20748 13160 m 20740 13138 20733 13116 20726 13095 ct ps 164 | 20706 13028 m 20700 13006 20694 12984 20688 12962 ct ps 165 | 20673 12895 m 20669 12872 20664 12850 20660 12827 ct ps 166 | 20650 12759 m 20647 12736 20644 12713 20642 12690 ct ps 167 | 20636 12621 m 20635 12599 20634 12576 20633 12553 ct ps 168 | 20632 12484 m 20632 12482 20632 12481 20632 12480 ct 20632 12458 20632 12436 20633 12415 ct 169 | ps 170 | 20636 12346 m 20637 12323 20639 12300 20641 12277 ct ps 171 | 20649 12208 m 20652 12186 20656 12163 20659 12140 ct ps 172 | 20672 12072 m 20676 12050 20681 12027 20687 12005 ct ps 173 | 20704 11938 m 20710 11916 20717 11894 20723 11872 ct ps 174 | 20745 11807 m 20753 11785 20761 11764 20770 11742 ct ps 175 | 20796 11679 m 20805 11658 20815 11637 20825 11616 ct ps 176 | 20856 11555 m 20867 11534 20878 11514 20890 11494 ct ps 177 | 20925 11435 m 20937 11416 20950 11396 20963 11377 ct ps 178 | 21003 11321 m 21016 11303 21030 11284 21045 11266 ct ps 179 | 21089 11213 m 21103 11196 21119 11179 21134 11162 ct ps 180 | 21182 11170 m 21197 11187 21212 11204 21227 11222 ct ps 181 | 21271 11275 m 21285 11293 21299 11311 21312 11330 ct ps 182 | 21352 11386 m 21365 11405 21377 11425 21389 11444 ct ps 183 | 21425 11504 m 21436 11524 21447 11544 21458 11564 ct ps 184 | 21488 11626 m 21498 11646 21508 11667 21517 11689 ct ps 185 | gr 186 | 0 8417 t 187 | pom 188 | count op_count sub {pop} repeat countdictstack dict_count sub {end} repeat b4_inc_state restore 189 | %%PageTrailer 190 | %%Trailer 191 | %%EOF 192 | -------------------------------------------------------------------------------- /slides/figures/regexs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CaffeineViking/concepts-primer/041cec40fa4a25cd954ce91da6d9d10ee31499a3/slides/figures/regexs.png -------------------------------------------------------------------------------- /slides/figures/tulogo.pdf: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:fbd8840f0e9523e994003d8c880bfbe48876ac9387023be9a6a7fbf8cb166051 3 | size 16571 4 | -------------------------------------------------------------------------------- /slides/slides.bib: -------------------------------------------------------------------------------- 1 | @techreport{N4553, 2 | shorthand={N4553}, 3 | year={2015-10-02}, 4 | month={{N4553,}}, 5 | title={{Working Draft, C++ Extension for Concepts}}, 6 | note={{\url{https://wg21.link/n4553}}} 7 | } 8 | 9 | @techreport{P0734R0, 10 | shorthand={P0734R0}, 11 | year={2017-07-14}, 12 | month={{P0734R0,}}, 13 | title={{Wording Paper, C++ Extension for Concepts}}, 14 | note={{\url{https://wg21.link/p0734r0}}} 15 | } 16 | 17 | @techreport{P0745R1, 18 | shorthand={P0745R1}, 19 | year={2018-04-29}, 20 | author={{Herb Sutter}}, 21 | month={{P0745R1,}}, 22 | title={{Concepts In-Place Syntax}}, 23 | note={{\url{https://wg21.link/p0745r1}}} 24 | } 25 | 26 | @techreport{P1079R0, 27 | shorthand={P1079R0}, 28 | author={{Bjarne Stroustrup}}, 29 | year={2018-05-06}, 30 | month={{P1079R0,}}, 31 | title={{A Minimal Solution to Concepts Syntax Problems}}, 32 | note={{\url{https://wg21.link/p1079R0}}} 33 | } 34 | 35 | @techreport{P00557R1, 36 | shorthand={P00557R1}, 37 | author={{Bjarne Stroustrup}}, 38 | year={2017-01-31}, 39 | month={{P00557R1,}}, 40 | title={{Concepts: The Future of Generic Programming}}, 41 | note={{\url{https://wg21.link/p00557r1}}} 42 | } 43 | 44 | @techreport{P1141R0, 45 | shorthand={P1141R0}, 46 | author={{Voutilainen, Köppe, Sutton, Sutter, Stroustrup etal.}}, 47 | year={2018-06-23}, 48 | month={{P1141R0,}}, 49 | title={{Yet Another Approach for Constrained Declarations}}, 50 | note={{\url{https://wg21.link/p1141R0}}} 51 | } 52 | -------------------------------------------------------------------------------- /slides/slides.pdf: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:d6a3eaff4b1507517edf958346879d07699f61ca2764f6b454c166a732495f1e 3 | size 1746305 4 | -------------------------------------------------------------------------------- /slides/slides.tex: -------------------------------------------------------------------------------- 1 | \documentclass{beamer} 2 | \usepackage[utf8]{inputenc} 3 | \usepackage{algorithmic} 4 | \usepackage{algorithm} 5 | \usepackage{booktabs} 6 | \usepackage{textcomp} 7 | \usepackage{amsfonts} 8 | \usepackage{amssymb} 9 | \usepackage{courier} 10 | \usepackage{tikz} 11 | \usepackage{soul} 12 | \usepackage{graphicx} 13 | \usepackage{listings} 14 | \usepackage{makecell} 15 | \usepackage{mathtools} 16 | \usepackage[font={small}, 17 | labelfont={color=black}]{caption} 18 | \usetheme{Rochester} 19 | 20 | \usefonttheme[onlymath]{serif} 21 | \beamertemplatenavigationsymbolsempty 22 | \setbeamertemplate{caption}[numbered] 23 | \title{\Large{\textbf{A C\texttt{++} Concepts Primer:}}\\ 24 | \large{\emph{defining and applying constraints}}} 25 | \author{\vspace{2ex}\\ 26 | \textbf{Erik Sven Vasconcelos Jansson}\\ 27 | {\href{mailto:erik.s.v.jansson@tum.de} 28 | {\texttt{}}} \\ 29 | {at Technical University of Munich}} 30 | 31 | \lstset{basicstyle=\footnotesize\ttfamily, 32 | breakatwhitespace = false, 33 | breaklines = true, 34 | keepspaces = true, 35 | language = C++, 36 | showspaces = false, 37 | showstringspaces = false, 38 | frame = tb, 39 | numbers = left, 40 | numbersep = 5pt, 41 | xleftmargin = 16pt, 42 | framexleftmargin = 16pt, 43 | escapeinside={<@}{@>}, 44 | morekeywords = { 45 | concept, 46 | requires, 47 | T, U, N, 48 | point2, 49 | vector, 50 | noexcept, 51 | size_t, 52 | decltype 53 | }} 54 | 55 | \let\svthefootnote\thefootnote 56 | \textheight 1in 57 | \newcommand\blankfootnote[1]{% 58 | \let\thefootnote\relax\footnotetext{#1}% 59 | \let\thefootnote\svthefootnote% 60 | } 61 | \let\svfootnote\footnote 62 | \renewcommand\footnote[2][?]{% 63 | \if\relax#1\relax% 64 | \blankfootnote{#2}% 65 | \else% 66 | \if?#1\svfootnote{#2}\else\svfootnote[#1]{#2}\fi% 67 | \fi 68 | } 69 | 70 | \usepackage{etoolbox} 71 | \makeatletter 72 | \patchcmd{\endbeamer@frameslide}{\ifx\beamer@frametitle\@empty}{\iffalse}{}{\errmessage{failed to patch}} 73 | \makeatother 74 | 75 | \addtobeamertemplate{frametitle}{}{% 76 | \begin{tikzpicture}[remember picture,overlay] 77 | \node[anchor=north east,yshift=-7pt,xshift=-5pt] at (current page.north east) {\includegraphics[height=0.7cm]{figures/tulogo}}; 78 | \end{tikzpicture}} 79 | 80 | \setbeamerfont{bibliography item}{size=\tiny} 81 | \setbeamerfont{bibliography entry author}{size=\tiny} 82 | \setbeamerfont{bibliography entry title}{size=\tiny} 83 | \setbeamerfont{bibliography entry location}{size=\tiny} 84 | \setbeamerfont{bibliography entry note}{size=\tiny} 85 | \renewcommand*{\thefootnote}{\fnsymbol{footnote}} 86 | \setbeamertemplate{footline}[frame number] 87 | 88 | \makeatletter 89 | \let\@@magyar@captionfix\relax 90 | \makeatother 91 | 92 | \begin{document} 93 | \frame{\titlepage} 94 | \begin{frame}[fragile]{Presentation Outline} 95 | \begin{columns} 96 | \column{0.52\textwidth} 97 | \begin{enumerate} 98 | \item Generic programming in C\texttt{++} \begin{itemize} 99 | \item{\underline{unconstrained} templates.} 100 | \end{itemize} 101 | \item Problems and some solutions \begin{itemize} 102 | \item{read the documentation,} 103 | \item{type traits plus SFINAE,} 104 | \item{... arcane ``magic'' code.} 105 | \end{itemize} 106 | \item How \textbf{Concepts Lite} improve \begin{itemize} 107 | \item{\textcolor{red}{\st{un}}\underline{constrained} templates.} 108 | \end{itemize} 109 | \item \emph{Applying concept constraints} \begin{itemize} 110 | \item using \texttt{requires} clause, 111 | \item overload with constraint, 112 | \item operations on constraint. 113 | \end{itemize} 114 | \end{enumerate} 115 | \column{0.48\textwidth} 116 | \begin{enumerate} 117 | \setcounter{enumi}{4} 118 | \item \emph{Defining list of constraints} \begin{itemize} 119 | \item \texttt{requires} expressions, \begin{itemize} 120 | \item simple, 121 | \item type, 122 | \item compound, 123 | \item nested. 124 | \end{itemize} 125 | \item requirement\, evaluation, 126 | \item naming with \texttt{concept}, 127 | \item defining good concepts. 128 | \end{itemize} 129 | \item Standard Library Concepts 130 | \item Terse syntaxes for C\texttt{++}20? 131 | \item Summary, post-Rapperswil 132 | \end{enumerate} 133 | \end{columns} 134 | \end{frame} 135 | 136 | \begin{frame}[fragile]{Generic Programming} 137 | C\texttt{++} is a rich multi-paradigm language, supporting both \emph{run time} and \emph{compile-time polymorphism}. At compile-time, \emph{templates} give support for \emph{generic programming}. However, templates are fragile, unlike their run time counterpart, because they are \emph{unconstrained}. This leads to \emph{bad error messages}, \emph{unclear interfaces}, and \underline{violence}. 138 | 139 | \vspace{1em} 140 | Let's build up an example of the current state of generics in C\texttt{++}, and see where they \emph{succeed} \& \emph{fail}; and where \emph{concepts} may help! 141 | \end{frame} 142 | 143 | \begin{frame}[fragile]{Regular Programming} 144 | \framesubtitle{Generic Programming} 145 | Consider this function below, what does it do? How do you know? \textbf{Note:} this is not a very good implementation, e.g. \texttt{p > q} is bad. 146 | \begin{center} 147 | \begin{lstlisting}[caption={a ``mysterious'' function; can you figure out what this code is?}] 148 | double f(const double* p, 149 | const double* const q) { 150 | double x { }; 151 | const double s = q - p; 152 | while (p != q) 153 | x += *p++; 154 | return x / s; 155 | } \end{lstlisting} 156 | \end{center} 157 | \end{frame} 158 | 159 | \begin{frame}[fragile]{Operator Overloading} 160 | \framesubtitle{Generic Programming} 161 | We can make ``similarly behaving things'', have the same syntaxes. 162 | \begin{center} 163 | \begin{lstlisting}[caption={boilerplate for the next example; a very incomplete point class.}] 164 | struct point2 { 165 | double x, y; 166 | point2& operator+=(const point2& p); 167 | }; 168 | 169 | point2& point2::operator+=(const point2& p) { 170 | x += p.x; y += p.y; 171 | return *this; 172 | } 173 | 174 | point2 operator/(const point2& p, double s) { 175 | return { p.x / s, p.y / s }; 176 | } \end{lstlisting} 177 | \end{center} 178 | \end{frame} 179 | 180 | \begin{frame}[fragile]{Mysterious Functions?} 181 | \framesubtitle{Generic Programming} 182 | Consider this function below, what does it do? How do you know? \textbf{Note:} this is not a very good implementation, e.g. \texttt{p > q} is bad. 183 | \begin{center} 184 | \begin{lstlisting}[caption={another mysterious, yet strangely familiar function (déjà vu?).}] 185 | point2 f(const point2* p, 186 | const point2* const q) { 187 | point2 x { }; 188 | const double s = q - p; 189 | while (p != q) 190 | x += *p++; 191 | return x / s; 192 | } \end{lstlisting} 193 | \end{center} 194 | \end{frame} 195 | 196 | \begin{frame}[fragile]{Template Parameters} 197 | \framesubtitle{Generic Programming} 198 | Obviously, both functions are finding the mean/average somehow. Since both have the same syntax (thanks to operator overloading) we can ``lift'' the implementation. Now, what is \emph{required} from \textbf{\texttt{T}}? 199 | \begin{center} 200 | \begin{lstlisting}[caption={natural generalization of the function from the previous slides.}] 201 | template 202 | T mean(const T* begin, 203 | const T* const end) { 204 | T sum { }; 205 | const double size = end - begin; 206 | while (begin != end) 207 | sum += *begin++; 208 | return sum / size; 209 | } \end{lstlisting} 210 | \end{center} 211 | \end{frame} 212 | 213 | \begin{frame}[fragile]{Comically Bad Errors} 214 | \framesubtitle{Generic Programming} 215 | Because \emph{requirements} of unconstrained templates aren't explicit, a user which hasn't understood the interface may get horrible errors because the syntax is checked \textbf{after} \emph{template instantiation}. Which might be deeply nested. Can't we check \textbf{before} instantiating this? 216 | \begin{center} 217 | \begin{lstlisting}[caption={classic code examples that give ``bad'' template error messages.}] 218 | std::list l { 5, 1, 4, 3, 2 }; 219 | std::sort(l.begin(), l.end()); 220 | // <@\texttildelow @>48 lines of errors in gcc. 221 | 222 | struct Widget { }; 223 | 224 | std::set w; 225 | w.insert(Widget{}); 226 | // <@\texttildelow @>412 lines here.\end{lstlisting} 227 | \end{center} 228 | \end{frame} 229 | 230 | \begin{frame}[fragile]{Parameter Predicates} 231 | \framesubtitle{Generic Programming} 232 | Here we have \emph{constrained} the template parameter list, allowing the compilers to check requirements \textbf{before} instantiating the template. 233 | \begin{center} 234 | \begin{lstlisting}[caption={constraining the function template using a \texttt{requires} clause.}] 235 | template requires DefaultConstructible 236 | && SummableWith && 237 | ScalableWith 238 | T mean(const T* begin, 239 | const T* const end) { 240 | T sum { }; 241 | const double size = end - begin; 242 | while (begin != end) 243 | sum += *begin++; 244 | return sum / size; 245 | } \end{lstlisting} 246 | \end{center} 247 | \end{frame} 248 | 249 | \begin{frame}[fragile]{Problems and Solutions} 250 | Before considering concepts, let's look at how we currently solve the problems we've discussed, and where these fall short. As you will shortly see, specifying constraints by concept is vastly better. 251 | \vspace{1em} 252 | \begin{itemize} 253 | \item{\textbf{Just read the documentation:} good luck with that, even when people read it, they might implement it incorrectly :(} 254 | \item{\textbf{Type traits and SFINAE:} powerful, and works in many of the cases we use concepts. \textbf{Not} easy to specify constraints.} 255 | \item{\textbf{Tag dispatching plus libraries:} hacky, not discussed here.} 256 | \end{itemize} 257 | \end{frame} 258 | 259 | \begin{frame}[fragile]{Read the Specifications} 260 | \framesubtitle{Problems and Solutions} 261 | \begin{center} 262 | \begin{table} 263 | \begin{tabular}{ccc} 264 | \toprule 265 | \bf{Expression} & \bf{Return Value is} & \bf{Requirements Specification} \\ 266 | \midrule 267 | \texttt{x == y} & \texttt{bool} convertible & \makecell[l]{\texttt{==}\, is an equivalence relation,\\ 268 | that is, satisfies the following:\\ 269 | $\rightarrow$ for all \texttt{x}, \texttt{x == x} is satis.,\\ 270 | $\rightarrow$ if \texttt{x == y}, then \texttt{y == x},\\ 271 | $\rightarrow$ if \texttt{x == y}, and\; \texttt{y == z},\\ 272 | \;\;\;\, then \texttt{x == z}, follows too. 273 | } \\ 274 | \bottomrule 275 | \end{tabular} 276 | \caption{\texttt{EqualityComparable} requirements from the C\texttt{++} standard.} 277 | \end{table} 278 | \end{center} 279 | \end{frame} 280 | 281 | \begin{frame}[fragile]{Type Trait and SFINAE} 282 | \framesubtitle{Problems and Solutions} 283 | \begin{center} 284 | \begin{lstlisting}[caption={expressing \texttt{EqualityComparable} as a SFINAE type trait.}] 285 | template 286 | struct is_equality_comparable : std::false_type { }; 287 | 288 | template 289 | struct is_equality_comparable() == std::declval() 292 | ,(void)0)>::type> : std::true_type { };\end{lstlisting} 293 | \end{center} 294 | \end{frame} 295 | 296 | \begin{frame}[fragile]{Concepts to the Rescue} 297 | \framesubtitle{Problems and Solutions} 298 | \begin{center} 299 | \begin{lstlisting}[caption={\texttt{EqualityComparable} concept which ``satisfies''\footnote{not really; see the Ranges TS, this is \texttt{WeaklyEqualityComparable} \texttt{:)}} Table 1.}] 300 | template 301 | concept EqualityComparable = requires(T x, U y) { 302 | { x == y } -> bool; 303 | { x != y } -> bool; 304 | { y != x } -> bool; 305 | { y == x } -> bool; 306 | }; \end{lstlisting} 307 | \end{center} 308 | \end{frame} 309 | 310 | \begin{frame}[fragile]{Overloading by SFINAE?} 311 | \framesubtitle{Problems and Solutions} 312 | \begin{center} 313 | \begin{lstlisting}[caption={overloading the constructor by using SFINAE \& type traits...}] 314 | struct Factory { 315 | enum { INTEGRAL, FLOATING } m_type; 316 | 317 | template> 320 | Factory(T) : m_type { INTEGRAL } {} 321 | template> 324 | Factory(T) : m_type { FLOATING } {} 325 | }; \end{lstlisting} 326 | \end{center} 327 | \end{frame} 328 | 329 | \begin{frame}[fragile]{Overloading by SFINAE} 330 | \framesubtitle{Problems and Solutions} 331 | \begin{center} 332 | \begin{lstlisting}[caption={...doesn't work if we don't use a \texttt{dummy} for disambiguation.}] 333 | struct Factory { 334 | enum { INTEGRAL, FLOATING } m_type; 335 | template struct dummy { dummy(int) { } }; 336 | template> 339 | Factory(T, dummy<0>=0) : m_type { INTEGRAL } {} 340 | template> 343 | Factory(T, dummy<1>=0) : m_type { FLOATING } {} 344 | }; \end{lstlisting} 345 | \end{center} 346 | \end{frame} 347 | 348 | \begin{frame}[fragile]{Concepts to the Rescue} 349 | \framesubtitle{Problems and Solutions} 350 | \begin{center} 351 | \begin{lstlisting}[caption={overloading based on constraint with the \texttt{requires} clause.}] 352 | struct Factory { 353 | enum { INTEGRAL, FLOATING } m_type; 354 | template requires Integral 355 | Factory(T) : m_type { INTEGRAL } {} 356 | template requires Floating 357 | Factory(T) : m_type { FLOATING } {} 358 | }; \end{lstlisting} 359 | \end{center} 360 | \end{frame} 361 | 362 | \begin{frame}[fragile]{\textbf{Concepts Lite}} 363 | An extension to C\texttt{++} templates, allowing compile-time checking of template parameters by \emph{constraining} them via \emph{syntax requirements}. 364 | 365 | \begin{itemize} 366 | \item{\textbf{Applying constraints:} by using the \texttt{requires} \emph{clauses}. \ $\leftarrow$ \textbf{!}} 367 | \item{\textbf{Defining requirements:} with an \texttt{requires} \emph{expression}. $\leftarrow$ \textbf{!}} 368 | \end{itemize} 369 | 370 | Constraints can be applied more intuitively with a \emph{terse syntax} but since it's still controversial, we'll present a subset: \textbf{Concepts Zero}. 371 | 372 | \begin{itemize} 373 | \item{\textbf{History:} the first concepts proposal came out in 2003, it was merged \& un-merged out of C\texttt{++}11 and postponed in C\texttt{++}17}. 374 | \end{itemize} 375 | \end{frame} 376 | 377 | \begin{frame}[fragile]{Applying Constraints} 378 | \begin{center} 379 | \includegraphics[width=0.9\textwidth]{figures/applying.png} 380 | \end{center} 381 | \end{frame} 382 | 383 | \begin{frame}[fragile]{Constraining Template Parameters} 384 | \framesubtitle{Applying Constraints} 385 | Both \emph{type} \& \emph{non-type template parameters} may be \emph{constrained} by using a \emph{requires clause}. The \emph{constraint expressions} on its right can be anything that evaluates to \texttt{bool} at compile-time. \emph{Instantiation} occurs \textbf{only} when the entire constraint expression evaluates \texttt{true}! 386 | \vspace{-1em} 387 | \begin{center} 388 | \begin{lstlisting}[caption={constraining types \& values by using the \texttt{requires} clause.}] 389 | template requires Add 390 | T add(T x, T y) { return x + y; } 391 | 392 | template requires Number class Matrix; 393 | 394 | 395 | 396 | template requires Even 397 | int square_even() { return N*N; } \end{lstlisting} 398 | \end{center} 399 | \end{frame} 400 | 401 | \begin{frame}[fragile]{Constraining Template Parameters} 402 | \framesubtitle{Applying Constraints} 403 | Both \emph{type} \& \emph{non-type template parameters} may be \emph{constrained} by using a \emph{requires clause}. The \emph{constraint expressions} on its right can be anything that evaluates to \texttt{bool} at compile-time. \emph{Instantiation} occurs \textbf{only} when the entire constraint expression evaluates \texttt{true}! 404 | \vspace{-1em} 405 | \begin{center} 406 | \begin{lstlisting}[caption={which even supports constraining C\texttt{++}20 generic lambdas!?}] 407 | template requires Add 408 | T add(T x, T y) { return x + y; } 409 | 410 | template requires Number class Matrix; 411 | auto add = [](T x, T y) requires Add { 412 | return x + y; 413 | }; 414 | template requires Even 415 | int square_even() { return N*N; } \end{lstlisting} 416 | \end{center} 417 | \end{frame} 418 | 419 | \begin{frame}[fragile]{Concept Overload Resolution Rule} 420 | \framesubtitle{Applying Constraints} 421 | \begin{columns} 422 | \column{0.735\textwidth} 423 | Intuitively, the most \emph{constrained overload} will be chosen (i.e. with the \textbf{most} requirements). Since this is now part of ``official'' \emph{overload resolution}, and isn't a ad-hoc method like SFINAE; it gives an uniform syntax with the rest of the language. The amount of edge-cases, and hacks is reduced. 424 | \vspace{-1.5em} 425 | \column{0.265\textwidth} 426 | \begin{center} 427 | \includegraphics[width=\textwidth]{figures/iterators.eps} 428 | \end{center} 429 | \end{columns} 430 | \begin{center} 431 | \begin{lstlisting}[caption={function overloading for \texttt{advance} based on type constraint.}] 432 | template requires ForwardIterator 433 | void advance(T& iterator, std::size_t distance); 434 | 435 | template requires RandomAccessIterator 436 | void advance(T& iterator, std::size_t distance); \end{lstlisting} 437 | \end{center} 438 | \end{frame} 439 | 440 | \begin{frame}[fragile]{Logical Operations on Constraints} 441 | \framesubtitle{Applying Constraints} 442 | \begin{columns} 443 | \column{0.7\textwidth} 444 | The constraint expression can also be a logical summation of constraints by using \texttt{\&\&} and \texttt{||}. They are similar to logical operators, as should be no surprise. These evaluate to \texttt{true} when: \hfill 445 | \vspace{-0.9em} 446 | \begin{itemize} 447 | \item{\textbf{conjunctions:} \textbf{both} constraints satisfied,} 448 | \item{\textbf{disjunctions:}\ \textbf{at least one} was satisfied.} 449 | \end{itemize} 450 | \column{0.3\textwidth} 451 | \begin{center} 452 | \includegraphics[width=0.815\textwidth]{figures/logical.eps} 453 | \vspace{1.0em} 454 | \end{center} 455 | \end{columns} 456 | \begin{center} 457 | \vspace{-1.0em} 458 | \begin{lstlisting} 459 | template requires is_integral_v || 460 | is_floating_point_v; 461 | T add(T x, T y) requires Summable { return x+y; } 462 | 463 | template requires Even && Num 464 | int square_even() { return N*N; } // value & type N \end{lstlisting} 465 | \end{center} 466 | \end{frame} 467 | 468 | \begin{frame}[fragile]{Defining Constraints} 469 | \begin{center} 470 | \includegraphics[width=0.9\textwidth]{figures/defining.png} 471 | \end{center} 472 | \end{frame} 473 | 474 | \begin{frame}[fragile]{Requirements} 475 | A list of syntactic \emph{requirements} for an template parameter can be checked by using an \emph{requires expression}. This expression evaluates to \texttt{true} when \textbf{all} requirements are \textbf{satisfied}. Artificial ``variables'' can be introduced, which have no linkage, storage or lifetime, and are only there for writing convenience (see e.g. \texttt{std::declval}). 476 | \framesubtitle{Defining Constraints} 477 | \begin{itemize} 478 | \item{\textbf{simple:} just asserts the validity of some expression \texttt{;},} 479 | \item{\textbf{type:} checks the validity of some type by a \texttt{typename} prefix,} 480 | \item{\textbf{compound:} validates the properties of some given expression,} 481 | \item{\textbf{nested:} specifies \textbf{more} requirements based on local variables.} 482 | \end{itemize} 483 | \end{frame} 484 | 485 | \begin{frame}[fragile]{Simple Requirements} 486 | \framesubtitle{Requirements} 487 | \begin{center} 488 | \begin{lstlisting}[caption={simple requirements in an incomplete \texttt{ForwardIterator}.}] 489 | template 490 | concept ForwardIterator = requires { 491 | T{}; 492 | T(); 493 | }; 494 | \end{lstlisting} 495 | \end{center} 496 | \end{frame} 497 | 498 | \begin{frame}[fragile]{Type Requirements} 499 | \framesubtitle{Requirements} 500 | \begin{center} 501 | \begin{lstlisting}[caption={type requirements in our incomplete \texttt{ForwardIterator}.}] 502 | template 503 | concept ForwardIterator = requires { 504 | typename iterator_traits::value_type; 505 | typename iterator_traits::difference_type; 506 | typename iterator_traits::reference; 507 | typename iterator_traits::pointer; 508 | typename iterator_traits::iterator_category; 509 | }; \end{lstlisting} 510 | \end{center} 511 | \end{frame} 512 | 513 | \begin{frame}[fragile]{Compound Requirements} 514 | \framesubtitle{Requirements} 515 | \begin{center} 516 | \begin{lstlisting}[caption={compound requirements found in an \texttt{ForwardIterator}.}] 517 | template 518 | concept ForwardIterator = requires(T x) { 519 | { *x } -> iterator_traits::reference; 520 | { ++x } -> T&; 521 | { x++ } -> T; 522 | } && requires(T x, T y) { 523 | { std::swap(x, y) } noexcept; 524 | }; \end{lstlisting} 525 | \end{center} 526 | \end{frame} 527 | 528 | \begin{frame}[fragile]{Nested Requirements} 529 | \framesubtitle{Requirements} 530 | \begin{center} 531 | \begin{lstlisting}[caption={usage of nested requirement in an \texttt{Allocatable} concept.}] 532 | template 533 | concept Allocatable = requires(T x, std::size_t n) { 534 | requires Same; 535 | { x.<@\texttildelow @>T() } noexcept; 536 | requires Same; 537 | requires Same; 538 | { delete new T[n] }; 539 | { delete new T }; 540 | }; \end{lstlisting} 541 | \end{center} 542 | \end{frame} 543 | 544 | \begin{frame}[fragile]{Naming Constraints} 545 | \framesubtitle{Defining Constraints} 546 | One can name \emph{complex constraints} into a \emph{concept} with \texttt{concept}. It's a glorified \texttt{constexpr bool} without Turing completeness :) 547 | \vspace{-0.7em} 548 | \begin{center} 549 | \begin{lstlisting}[caption={giving names to constraints by using the \texttt{concept} keyword.}] 550 | template 551 | concept ForwardIterator = InputIterator && 552 | DefaultConstructible && 553 | EqualityComparable && 554 | WeaklyIncrementable && 555 | SwappableWith; 556 | template 557 | concept BidirectionalIterator = requires(T x) { 558 | { --x } -> T&; 559 | { x-- } -> T; 560 | } && ForwardIterator; 561 | template concept Even = (N % 2) == 0;\end{lstlisting} 562 | \end{center} 563 | \end{frame} 564 | 565 | \begin{frame}[fragile]{Defining ``Good'' Concepts} 566 | \framesubtitle{Defining Constraints} 567 | Some concepts are better than others. Many of the concepts here, are not ``good'' concepts. The core idea is that concepts should be defined to make types and algorithms 'plug compatible'. Which is:\hfill 568 | \vspace{0.8em} 569 | \begin{itemize} 570 | \item{to write \emph{algorithms} that can be used for a \emph{variety of types}, and} 571 | \item{to define \emph{types} that can be used with a \emph{variety of algorithms}.} 572 | \end{itemize} 573 | \begin{center} 574 | \emph{``the ideal is not minimal requirements, but requirements expressed in terms of fundamental and complete concepts.'' -- B.\ Stroustrup} 575 | \end{center} 576 | \end{frame} 577 | 578 | \begin{frame}[fragile]{Standard Library Concepts} 579 | Writing many of the ``boilerplate'' concepts isn't fun, and it's easy to get them wrong. Luckily, C\texttt{++}20 will be receiving a bunch from the \emph{Ranges TS}. Many of these we've defined in this presentation!! 580 | \vspace{1em} 581 | \begin{center} 582 | \begin{table} 583 | \begin{tabular}{cccc} 584 | \toprule 585 | \textbf{Core} & \textbf{Comparison} & \textbf{Object} & \textbf{Callable}\\ 586 | \midrule 587 | Same & Boolean & Copyable & Invocable \\ 588 | Integral & EqualityComparable & Movable & Predicate \\ 589 | Swappable & StrictTotallyOrdered & Regular & Relation \\ 590 | Constructible & + $\cdots$With variants! & Semiregular & WeakOrder \\ 591 | \bottomrule 592 | \end{tabular} 593 | \caption{excerpt of the concept groups from the \texttt{} header.} 594 | \end{table} 595 | \end{center} 596 | \end{frame} 597 | 598 | \begin{frame}[fragile]{Ranges TS Library} 599 | \framesubtitle{Standard Library Concepts} 600 | Many of the remaining concepts are found in the \emph{ranges library}, by \emph{Eric Niebler}, under the \texttt{} header. e.g \texttt{InputIterator}. Along with them, we'll get a concepts-ready STL for C\texttt{++}20, which enable cool things like \emph{lazy evaluation} by using \emph{range views/actions}. 601 | \begin{center} 602 | \begin{lstlisting}[caption={example of the composability possibilities of range adaptors.}] 603 | std::vector v { 10, 2, 6, 10, 4, 1, 9, 5, 8, 3 }; 604 | v = std::move(v) | action::sort | action::unique; 605 | // ---> v = { 1, 2, 3, 4, 5, 6, 8, 9, 10 } <--- 606 | auto range_of_v = v | view::remove_if([](int i) { 607 | return i % 2 == 1; }) 608 | | view::transform([](int i) { 609 | return to_string(i); }) 610 | | view::take(4); 611 | // ---> range_of_v = { "2", "4", "6", "8" } <--- \end{lstlisting} 612 | \end{center} 613 | \end{frame} 614 | 615 | \begin{frame}[fragile]{Terse Syntaxes} 616 | \begin{itemize} 617 | \item{\textbf{Natural syntax} by \emph{Bjarne Stroustrup et al.}, which was part of the Concepts TS, and is implemented in \texttt{gcc}'s \texttt{-fconcepts}. Issues was related to ambiguous syntax and introducer syntax.} 618 | \item{\textbf{Concepts in-place syntax} by \emph{Herb Sutter}. In order to ``gain'' more consensus, removed ambiguity and dependent binding. It is forward-compatible with Bjarne syntax, but is a bit verbose.} 619 | \item{\textbf{Adjective syntax variants} by \emph{Thomas Köppe et al.}, after the Rapperswil \emph{``Bjarne / Herb stand-off''}, a new syntax: YAACD. It's essentially a constrained \texttt{auto}, and handles simpler cases.} 620 | \end{itemize} 621 | \end{frame} 622 | 623 | \begin{frame}[fragile]{Natural Syntax} 624 | \framesubtitle{Terse Syntaxes} 625 | \begin{center} 626 | \begin{lstlisting} 627 | template requires Sortable 628 | void sort(T& range); 629 | 630 | template 631 | void sort(T& range); 632 | void sort(Sortable& range); 633 | void sort(RandomAccessIterator begin, 634 | RandomAccessIterator end); 635 | auto sort = [](T& r) { }; 636 | auto sort = [](Sortable& r) { }; 637 | 638 | BidirectionalIterator it = l.begin(); 639 | 640 | Mergeable{I1, I2, O} 641 | O merge(I1 f1, I1 l1, I2 f2, I2 l2, O d); \end{lstlisting} 642 | \end{center} 643 | \end{frame} 644 | 645 | \begin{frame}[fragile]{Concepts In-Place Syntax} 646 | \framesubtitle{Terse Syntaxes} 647 | \begin{center} 648 | \begin{lstlisting} 649 | template requires Sortable 650 | void sort(T& range); 651 | 652 | template 653 | void sort(T& range); 654 | void sort(Sortable{}& range); 655 | void sort(RandomAccessIterator{T} begin, 656 | T end); 657 | auto sort = [](T& r) { }; 658 | auto sort = [](Sortable{}& r) { }; 659 | 660 | BidirectionalIterator{T} it = l.begin(); 661 | 662 | template 663 | O merge(I1 f1, I1 l1, I2 f2, I2 l2, O d); \end{lstlisting} 664 | \end{center} 665 | \end{frame} 666 | 667 | \begin{frame}[fragile]{Constrained \textbf{auto} Syntax} 668 | \framesubtitle{Terse Syntaxes} 669 | \begin{center} 670 | \begin{lstlisting} 671 | template requires Sortable 672 | void sort(T& range); 673 | 674 | template 675 | void sort(T& range); 676 | void sort(Sortable auto& range); 677 | template 678 | void sort(T begin, T end); 679 | auto sort = [](T& r) { }; 680 | auto sort = [](Sortable auto& r) { }; 681 | 682 | BidirectionalIterator auto it = l.begin(); 683 | template 684 | requires Mergeable 685 | O merge(I1 f1, I1 l1, I2 f2, I2 l2, O d); \end{lstlisting} 686 | \end{center} 687 | \end{frame} 688 | 689 | \begin{frame}[fragile]{Concepts Summary} 690 | \framesubtitle{With post-Rapperswil Status!} 691 | \begin{itemize} 692 | \item{Generic programming for C\texttt{++} uses \emph{unconstrained templates}, which leads to \emph{horrible error messages}, and \emph{fragile interfaces}.} 693 | \item{Existing techniques (like SFINAE) are either \emph{insufficient},\ \emph{not easy to define},\ or have laughably \emph{obscure edge-cases} when it comes to defining, and using \emph{template parameter constraints}.} 694 | \item{With \emph{concepts} we can \emph{constrain template parameters} but not have to suffer from the problems above, by using its features:} 695 | \begin{itemize} 696 | \item{\texttt{requires} \emph{clauses}, \texttt{requires} \emph{expressions} \& \emph{terse syntaxes}.} 697 | \end{itemize} 698 | \item{Generic programming in C\texttt{++}20 is a lot nicer using concepts!} 699 | \item{\textbf{Status:} Concepts, SLC/Ranges, Contracts, likely for C\texttt{++}20!} 700 | \end{itemize} 701 | \end{frame} 702 | 703 | \frame{\frametitle{Questions?} \begin{center} 704 | \includegraphics[height=0.85\textheight] 705 | {figures/regexs.png} \end{center} } 706 | \begin{frame}{References} 707 | \nocite{*} 708 | \bibliographystyle{alpha} 709 | \bibliography{slides} 710 | \end{frame} 711 | \frame{\frametitle{Acknowledgements} 712 | \begin{itemize} 713 | \item{\textbf{Concepts Lite in Practice} by \emph{R. Orr} (2016) for giving a nice and intuitive introduction to Concepts Lite TS at ACCU 2016. Some of the examples are taken from his slides and the article.} 714 | \item{\textbf{Generic Programming with Concepts} by \emph{A. Sutton} (2015), for presenting Concepts Lite from another angle. Many of the motivating example are based on those in his presentation too.} 715 | \item{I would like to thank \emph{P. Sommerlad}, for hosting the wonderful meeting in Rapperswil (2018), and allowing me to participate in the discussion on Concepts along with other topics in EWG.} 716 | \item{Finally, I would like to thank \emph{T. Lasser} and the other teachers and participants of ``Discovering and Teaching Modern C\texttt{++}''!} 717 | \end{itemize} 718 | } 719 | \end{document} 720 | --------------------------------------------------------------------------------