Template-Meta-Tutorial

所属分类:文章/文档
开发工具:C++
文件大小:2255KB
下载次数:0
上传日期:2018-10-31 08:28:54
上 传 者sh-1993
说明:  一种基本的C++模板元编程
(A basic C++ Template Meta Programming)

文件列表:
.editorconfig (41, 2018-10-31)
ClassInClass (0, 2018-10-31)
ClassInClass\ClassInClass.cpp (652, 2018-10-31)
Factorial (0, 2018-10-31)
Factorial\Factorial.cpp (695, 2018-10-31)
Inheritance (0, 2018-10-31)
Inheritance\CheckInheritance.cpp (3388, 2018-10-31)
LICENSE (35141, 2018-10-31)
Matrix (0, 2018-10-31)
Matrix\BestMatrix.cpp (6088, 2018-10-31)
Matrix\BetterVector.cpp (4019, 2018-10-31)
Matrix\SimpleVector.cpp (3036, 2018-10-31)
PowerSet (0, 2018-10-31)
PowerSet\PowerSet.cpp (6927, 2018-10-31)
PowerSet\RunTimePowerSet.cpp (2161, 2018-10-31)
Presentation.pdf (2633379, 2018-10-31)
StaticAssert (0, 2018-10-31)
StaticAssert\BestSA.cpp (1345, 2018-10-31)
StaticAssert\SimplestSA.cpp (376, 2018-10-31)
StaticAssert\TrivialTemplateSA.cpp (396, 2018-10-31)
TemplateSpecialization (0, 2018-10-31)
TemplateSpecialization\FullTemplateSpec.cpp (620, 2018-10-31)
TemplateSpecialization\IsPointer.cpp (737, 2018-10-31)
TemplateSpecialization\PartialTemplateSpec.cpp (620, 2018-10-31)
TemplateSpecialization\Tuple.cpp (828, 2018-10-31)
TypeList (0, 2018-10-31)
TypeList\BasicTypeList.cpp (465, 2018-10-31)
TypeList\TL_Append.cpp (2345, 2018-10-31)
TypeList\TL_Index.cpp (1651, 2018-10-31)
TypeList\TypeList.cpp (1103, 2018-10-31)
TypeSelection (0, 2018-10-31)
TypeSelection\Select.cpp (833, 2018-10-31)
index.html (203, 2018-10-31)

# C++ Template Meta Tutorial This repository contains a presentation that is an introduction to C++ Template Meta Programming. All of the code in the presentation is in this repository. Much of what is shown in this presentation is no longer required to know with the increased support for template meta programming in C++11, C++14, and C++17. So why learn it? This presentation includes derivations of each of the techniques which will help get you into the mindset of template meta programming. Furthermore, while the actual code may be legacy, all of these techniques are still fundamentals and frequently used for template meta programming. ## Links A copy of the presentation is hosted [here](https://www.zwimer.com/Template-Meta-Tutorial/Presentation.pdf). The code repository is located on github [here](https://www.github.com/zwimer/Template-Meta-Tutorial/). ## Disclaimer C++ Template Meta is a huge and very diverse topic. It would be naive to say that this tutorial encompasses even a small portion of this topic. It is just a small introduction to some of techniques used in TMP. Furthermore, this presentation was designed to be given by someone who knows TMP. As such, while the presentation contains all necessary information, explanations may be in bullet points as it was written so that the instructor could explain each point. ## Texts This presentation _heavily_ utilizes the following text: [Modern C++ Design](https://www.mimuw.edu.pl/~mrp/cpp/SecretCPP/Addison-Wesley%20-%20Modern%20C++%20Design.%20Generic%20Programming%20and%20Design%20Patterns%20Applied.pdf) by Andrei Alexandrescu. If you are interested in TMP, I highly recommend this book. ## Requirements The code in this repository is compiled with clang++ version 7.0.2, and gcc 4.9.2. C++99 is required for most of the code, however some of the files require C++14. The reason different compilers and versions of C++ are used is to demonstrate examples where clarity of error messages is helpful and to demonstrate how C++ TMP has evolved from the primitive form you will learn to a more advanced and useful form which includes variadic templates among other amazing features.

近期下载者

相关文件


收藏者