Commit 866bbf16 authored by GILLES Sebastien's avatar GILLES Sebastien
Browse files

Cleaning-up template part.

parent a0962558
......@@ -4,20 +4,20 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"# [Getting started in C++](/) - [Templates](/notebooks/4-Templates/0-main.ipynb)"
"# [Getting started in C++](/) - [Templates](./0-main.ipynb)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"* [Introduction to the concept of templates](/notebooks/4-Templates/1-Intro.ipynb)\n",
" * [TP 12](/notebooks/4-Templates/1b-TP.ipynb)\n",
"* [Specialization](/notebooks/4-Templates/2-Specialization.ipynb)\n",
"* [Special syntax: typename, template and mandatory this](/notebooks/4-Templates/3-Syntax.ipynb)\n",
" * [TP 13](/notebooks/4-Templates/3b-TP.ipynb)\n",
"* [Metaprogramming](/notebooks/4-Templates/4-Metaprogramming.ipynb)\n",
"* [Hints to more advanced concepts with templates](/notebooks/4-Templates/5-MoreAdvanced.ipynb)"
"* [Introduction to the concept of templates](./1-Intro.ipynb)\n",
" * [TP 12](./1b-TP.ipynb)\n",
"* [Specialization](./2-Specialization.ipynb)\n",
"* [Special syntax: typename, template and mandatory this](./3-Syntax.ipynb)\n",
" * [TP 13](./3b-TP.ipynb)\n",
"* [Metaprogramming](./4-Metaprogramming.ipynb)\n",
"* [Hints to more advanced concepts with templates](./5-MoreAdvanced.ipynb)"
]
},
{
......@@ -25,7 +25,7 @@
"metadata": {},
"source": [
"\n",
"© _CNRS 2016_ - _Inria 2018-2019_ \n",
"© _CNRS 2016_ - _Inria 2018-2020_ \n",
"_This notebook is an adaptation of a lecture prepared by David Chamont (CNRS) under the terms of the licence [Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0)](http://creativecommons.org/licenses/by-nc-sa/4.0/)_ \n",
"_The present version has been written by Sébastien Gilles and Vincent Rouvreau (Inria)_"
]
......@@ -35,14 +35,14 @@
"kernelspec": {
"display_name": "C++17",
"language": "C++17",
"name": "xeus-cling-cpp17"
"name": "xcpp17"
},
"language_info": {
"codemirror_mode": "text/x-c++src",
"file_extension": ".cpp",
"mimetype": "text/x-c++src",
"name": "c++",
"version": "-std=c++17"
"version": "17"
},
"latex_envs": {
"LaTeX_envs_menu_present": true,
......@@ -77,5 +77,5 @@
}
},
"nbformat": 4,
"nbformat_minor": 2
"nbformat_minor": 4
}
This diff is collapsed.
......@@ -4,7 +4,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"# [Getting started in C++](/) - [Templates](/notebooks/4-Templates/0-main.ipynb) - [Specialization](/notebooks/4-Templates/2-Specialization.ipynb)"
"# [Getting started in C++](/) - [Templates](./0-main.ipynb) - [Specialization](./2-Specialization.ipynb)"
]
},
{
......@@ -80,7 +80,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"Please notice the syntax: the definition provides template with no parameter in the brackets, and the `T` is replaced by the specialized type. As there are no template parameters left, the definition of the specialization must be put in a compiled file (or with an [`inline` keyword](/notebooks/1-ProceduralProgramming/4-Functions.ipynb#inline-functions) in header file)\n",
"Please notice the syntax: the definition provides template with no parameter in the brackets, and the `T` is replaced by the specialized type. As there are no template parameters left, the definition of the specialization must be put in a compiled file (or with an [`inline` keyword](../1-ProceduralProgramming/4-Functions.ipynb#inline-functions) in header file)\n",
"\n",
"Of course, as many specialization as you wish may be provided:"
]
......@@ -648,7 +648,7 @@
"metadata": {},
"source": [
"\n",
"© _CNRS 2016_ - _Inria 2018-2019_ \n",
"© _CNRS 2016_ - _Inria 2018-2020_ \n",
"_This notebook is an adaptation of a lecture prepared by David Chamont (CNRS) under the terms of the licence [Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0)](http://creativecommons.org/licenses/by-nc-sa/4.0/)_ \n",
"_The present version has been written by Sébastien Gilles and Vincent Rouvreau (Inria)_"
]
......@@ -658,14 +658,14 @@
"kernelspec": {
"display_name": "C++17",
"language": "C++17",
"name": "xeus-cling-cpp17"
"name": "xcpp17"
},
"language_info": {
"codemirror_mode": "text/x-c++src",
"file_extension": ".cpp",
"mimetype": "text/x-c++src",
"name": "c++",
"version": "-std=c++17"
"version": "17"
},
"latex_envs": {
"LaTeX_envs_menu_present": true,
......@@ -700,5 +700,5 @@
}
},
"nbformat": 4,
"nbformat_minor": 2
"nbformat_minor": 4
}
......@@ -4,7 +4,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"# [Getting started in C++](/) - [Templates](/notebooks/4-Templates/0-main.ipynb) - [Special syntax: typename, template and mandatory this](/notebooks/4-Templates/3-Syntax.ipynb)"
"# [Getting started in C++](/) - [Templates](./0-main.ipynb) - [Special syntax: typename, template and mandatory this](./3-Syntax.ipynb)"
]
},
{
......@@ -301,7 +301,7 @@
"source": [
"## Good practice: always check obvious template instantiations in test!\n",
"\n",
"If you have been attentive, you might see `Print()` above is faulty: we ask to print on screen a void function... An instantiation reveals the issue:"
"If you have been very attentive, you might see `Print()` above is faulty: we ask to print on screen a void function... An instantiation reveals the issue:"
]
},
{
......@@ -346,7 +346,7 @@
"metadata": {},
"source": [
"\n",
"© _CNRS 2016_ - _Inria 2018-2019_ \n",
"© _CNRS 2016_ - _Inria 2018-2020_ \n",
"_This notebook is an adaptation of a lecture prepared by David Chamont (CNRS) under the terms of the licence [Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0)](http://creativecommons.org/licenses/by-nc-sa/4.0/)_ \n",
"_The present version has been written by Sébastien Gilles and Vincent Rouvreau (Inria)_"
]
......@@ -356,14 +356,14 @@
"kernelspec": {
"display_name": "C++17",
"language": "C++17",
"name": "xeus-cling-cpp17"
"name": "xcpp17"
},
"language_info": {
"codemirror_mode": "text/x-c++src",
"file_extension": ".cpp",
"mimetype": "text/x-c++src",
"name": "c++",
"version": "-std=c++17"
"version": "17"
},
"latex_envs": {
"LaTeX_envs_menu_present": true,
......@@ -398,5 +398,5 @@
}
},
"nbformat": 4,
"nbformat_minor": 2
"nbformat_minor": 4
}
......@@ -4,7 +4,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"# [Getting started in C++](/) - [Templates](/notebooks/4-Templates/0-main.ipynb) - [Metaprogramming](/notebooks/4-Templates/4-Metaprogramming.ipynb)"
"# [Getting started in C++](/) - [Templates](./0-main.ipynb) - [Metaprogramming](./4-Metaprogramming.ipynb)"
]
},
{
......@@ -224,7 +224,7 @@
"metadata": {},
"source": [
"\n",
"© _CNRS 2016_ - _Inria 2018-2019_ \n",
"© _CNRS 2016_ - _Inria 2018-2020_ \n",
"_This notebook is an adaptation of a lecture prepared by David Chamont (CNRS) under the terms of the licence [Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0)](http://creativecommons.org/licenses/by-nc-sa/4.0/)_ \n",
"_The present version has been written by Sébastien Gilles and Vincent Rouvreau (Inria)_"
]
......@@ -234,14 +234,14 @@
"kernelspec": {
"display_name": "C++17",
"language": "C++17",
"name": "xeus-cling-cpp17"
"name": "xcpp17"
},
"language_info": {
"codemirror_mode": "text/x-c++src",
"file_extension": ".cpp",
"mimetype": "text/x-c++src",
"name": "c++",
"version": "-std=c++17"
"version": "17"
},
"latex_envs": {
"LaTeX_envs_menu_present": false,
......@@ -281,5 +281,5 @@
}
},
"nbformat": 4,
"nbformat_minor": 2
"nbformat_minor": 4
}
......@@ -4,7 +4,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"# [Getting started in C++](/) - [Templates](/notebooks/4-Templates/0-main.ipynb) - [Hints to more advanced concepts with templates](/notebooks/4-Templates/5-MoreAdvanced.ipynb)"
"# [Getting started in C++](/) - [Templates](./0-main.ipynb) - [Hints to more advanced concepts with templates](./5-MoreAdvanced.ipynb)"
]
},
{
......@@ -25,7 +25,7 @@
"\n",
"## Curiously recurrent template pattern (CRTP)\n",
"\n",
"One of my own favourite idiom (so much I didn't resist writing an [entry](/notebooks/7-Appendix/Crtp.ipynb) about it in the appendix).\n",
"One of my own favourite idiom (so much I didn't resist writing an [entry](../7-Appendix/Crtp.ipynb) about it in the appendix).\n",
"\n",
"The idea behind it is to provide a same set of a given functionality to classes that have otherwise nothing in common.\n",
"\n",
......@@ -50,7 +50,7 @@
"source": [
"## Traits\n",
"\n",
"A **trait** is a member of a class which gives exclusively an information about type. For instance let's go back to the `HoldAValue` class we wrote [earlier](/notebooks/4-Templates/2-Specialization.ipynb) in our template presentation:"
"A **trait** is a member of a class which gives exclusively an information about type. For instance let's go back to the `HoldAValue` class we wrote [earlier](./2-Specialization.ipynb) in our template presentation:"
]
},
{
......@@ -358,7 +358,7 @@
"metadata": {},
"outputs": [],
"source": [
"Print(5, \"hello\");"
"Print(5, \"hello\", \"world\");"
]
},
{
......@@ -394,7 +394,7 @@
"\n",
"You may want to be way more specific when defining a template parameter: instead of telling it might be whatever you want, you may impose that a specific template parameter should only be a type which is itself an instantiation of a template.\n",
"\n",
"Let's consider a very dumb template function which purpose is to call print the value of `size()` for a STL container. We'll see them more extensively in a [dedicated notebook](/notebooks/5-UsefulConceptsAndSTL/3-Containers.ipynb), but for now you just have to know that these containers take two template parameters:\n",
"Let's consider a very dumb template function which purpose is to call print the value of `size()` for a STL container. We'll see them more extensively in a [dedicated notebook](../5-UsefulConceptsAndSTL/3-Containers.ipynb), but for now you just have to know that these containers take two template parameters:\n",
"\n",
"- One that describe the type inside the container (e.g. `double` for `std::vector<double>`).\n",
"- Another optional one which specifies how the memory is allocated.\n",
......@@ -615,7 +615,7 @@
"metadata": {},
"source": [
"\n",
"© _CNRS 2016_ - _Inria 2018-2019_ \n",
"© _CNRS 2016_ - _Inria 2018-2020_ \n",
"_This notebook is an adaptation of a lecture prepared by David Chamont (CNRS) under the terms of the licence [Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0)](http://creativecommons.org/licenses/by-nc-sa/4.0/)_ \n",
"_The present version has been written by Sébastien Gilles and Vincent Rouvreau (Inria)_"
]
......@@ -625,14 +625,14 @@
"kernelspec": {
"display_name": "C++17",
"language": "C++17",
"name": "xeus-cling-cpp17"
"name": "xcpp17"
},
"language_info": {
"codemirror_mode": "text/x-c++src",
"file_extension": ".cpp",
"mimetype": "text/x-c++src",
"name": "c++",
"version": "-std=c++17"
"version": "17"
},
"latex_envs": {
"LaTeX_envs_menu_present": true,
......@@ -667,5 +667,5 @@
}
},
"nbformat": 4,
"nbformat_minor": 2
"nbformat_minor": 4
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment