Commit 26964ec1 authored by GILLES Sebastien's avatar GILLES Sebastien
Browse files

Cleaning-up object programming part.

parent 477ee2c2
......@@ -4,24 +4,24 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"# [Getting started in C++](/) - [Object programming](/notebooks/2-ObjectProgramming/0-main.ipynb)"
"# [Getting started in C++](/) - [Object programming](./0-main.ipynb)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"* [Introduction to the concept of object](/notebooks/2-ObjectProgramming/1-Introduction.ipynb)\n",
" * [TP 4](/notebooks/2-ObjectProgramming/1b-TP.ipynb)\n",
"* [Member functions](/notebooks/2-ObjectProgramming/2-Member-functions.ipynb)\n",
" * [TP 5](/notebooks/2-ObjectProgramming/2b-TP.ipynb)\n",
"* [Base constructors and destructor](/notebooks/2-ObjectProgramming/3-constructors-destructor.ipynb)\n",
" * [TP 6](/notebooks/2-ObjectProgramming/3b-TP.ipynb)\n",
"* [Encapsulation](/notebooks/2-ObjectProgramming/4-encapsulation.ipynb)\n",
" * [TP 7](/notebooks/2-ObjectProgramming/4b-TP.ipynb)\n",
"* [Static attributes](/notebooks/2-ObjectProgramming/5-static.ipynb)\n",
"* [Inheritance and polymorphism](/notebooks/2-ObjectProgramming/6-inheritance.ipynb)\n",
" * [TP 8](/notebooks/2-ObjectProgramming/6b-TP.ipynb)"
"* [Introduction to the concept of object](./1-Introduction.ipynb)\n",
" * [TP 4](./1b-TP.ipynb)\n",
"* [Member functions](./2-Member-functions.ipynb)\n",
" * [TP 5](./2b-TP.ipynb)\n",
"* [Base constructors and destructor](./3-constructors-destructor.ipynb)\n",
" * [TP 6](./3b-TP.ipynb)\n",
"* [Encapsulation](./4-encapsulation.ipynb)\n",
" * [TP 7](./4b-TP.ipynb)\n",
"* [Static attributes](./5-static.ipynb)\n",
"* [Inheritance and polymorphism](./6-inheritance.ipynb)\n",
" * [TP 8](./6b-TP.ipynb)"
]
},
{
......@@ -39,14 +39,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,
......@@ -81,5 +81,5 @@
}
},
"nbformat": 4,
"nbformat_minor": 2
"nbformat_minor": 4
}
......@@ -4,7 +4,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"# [Getting started in C++](/) - [Object programming](/notebooks/2-ObjectProgramming/0-main.ipynb) - [Introduction to the concept of object](/notebooks/2-ObjectProgramming/1-Introduction.ipynb)"
"# [Getting started in C++](/) - [Object programming](./0-main.ipynb) - [Introduction to the concept of object](./1-Introduction.ipynb)"
]
},
{
......@@ -169,7 +169,7 @@
"* By reference.\n",
"* By pointers.\n",
"\n",
"I didn't mention there the copy cost of a pass-by-value: copying a plain old data (POD) type such as an `int` or a `double` is actually cheap, and is recommended over a reference. But the story is not the same for an object: the cost of copying the object in the case of a pass-by-value may actually be quite high (imagine if there were an array with thousands of double values for instance) - and that's supposing the object is copyable (but we're not quite ready yet to deal with [that aspect](http://localhost:8888/notebooks/3-Operators/4-CanonicalForm.ipynb#Uncopyable-class)).\n",
"I didn't mention there the copy cost of a pass-by-value: copying a plain old data (POD) type such as an `int` or a `double` is actually cheap, and is recommended over a reference. But the story is not the same for an object: the cost of copying the object in the case of a pass-by-value may actually be quite high (imagine if there were an array with thousands of double values inside for instance) - and that's supposing the object is copyable (but we're not quite ready yet to deal with [that aspect](../3-Operators/4-CanonicalForm.ipynb#Uncopyable-class)).\n",
"\n",
"### Pass-by-const-reference\n",
"\n",
......@@ -296,7 +296,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"© _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)_"
]
......@@ -306,14 +306,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,
......@@ -348,5 +348,5 @@
}
},
"nbformat": 4,
"nbformat_minor": 2
"nbformat_minor": 4
}
......@@ -4,7 +4,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"# [Getting started in C++](/) - [Object programming](/notebooks/2-ObjectProgramming/0-main.ipynb) - [Member functions](/notebooks/2-ObjectProgramming/2-Member-functions.ipynb)"
"# [Getting started in C++](/) - [Object programming](./0-main.ipynb) - [Member functions](./2-Member-functions.ipynb)"
]
},
{
......@@ -27,7 +27,7 @@
"\n",
"But when Bjarne Stroustrup created the C++, its main idea was to extend these structs into full-fledged **classes** (to the point the work name of his language was *C with classes*...)\n",
"\n",
"One of the idea that was missing with C `struct` is the possibility to add as well member functions."
"One of the idea that was missing with original C `struct` was the possibility to add as well member functions; this is no longer the case:"
]
},
{
......@@ -92,7 +92,7 @@
"- **Method** is used in other programming languages, but for some reason Julia creators used this exact term for an entirely different concept. So to put in a nutshell a C++ method is akin to a Python one but not to what Julia calls a method.\n",
"- **Attributes** are in fact the data attributes AND the methods. It is however often used only to designate the data attributes.\n",
"\n",
"**WARNING**: In C++ you can't complete a class after the fact as you may for instance in Python. So all the methods and data atttributes have to be declared within the struct brackets here; if you need to add something you will have to recompile the class. This means especially you can't add directly a member function to a class provided by a third party library; we'll see shortly the mechanism you may use instead to do your bidding."
"**WARNING**: In C++ you can't complete a class after the fact as you could for instance in Python. So all the methods and data atttributes have to be declared within the struct brackets here; if you need to add something you will have to recompile the class. This means especially you can't add directly a member function to a class provided by a third party library; we'll see shortly the mechanism you may use instead to do your bidding."
]
},
{
......@@ -164,7 +164,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"That is not to say you should forget altogether the `this` keyword: it might mecessary in some contexts (for templates for instance - see [later](/notebooks/4-Templates/3-Syntax.ipynb)...)"
"That is not to say you should forget altogether the `this` keyword: it might be necessary in some contexts (for templates for instance - see [later](../4-Templates/3-Syntax.ipynb)...)"
]
},
{
......@@ -578,7 +578,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"© _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)_"
]
......@@ -588,14 +588,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,
......@@ -635,5 +635,5 @@
}
},
"nbformat": 4,
"nbformat_minor": 2
"nbformat_minor": 4
}
......@@ -4,7 +4,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"# [Getting started in C++](/) - [Object programming](/notebooks/2-ObjectProgramming/0-main.ipynb) - [(Base) constructors and destructor](/notebooks/2-ObjectProgramming/3-constructors-destructor.ipynb)"
"# [Getting started in C++](/) - [Object programming](./0-main.ipynb) - [(Base) constructors and destructor](./3-constructors-destructor.ipynb)"
]
},
{
......@@ -111,9 +111,9 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"### [WARNING] How to call a constructor without argument\n",
"### **[WARNING]** How to call a constructor without argument\n",
"\n",
"There is a technicality for constructor without arguments: they must be called without parenthesis (the reason is a possible confusion with a [functor](/notebooks/3-Operators/5-Functors.ipynb) - see Item 6 of \\cite{Meyers2001} or [this blog post](https://www.fluentcpp.com/2018/01/30/most-vexing-parse/) if you want to learn more about the reasons of this):"
"There is a technicality for constructor without arguments: they must be called without parenthesis (the reason is a possible confusion with a [functor](../3-Operators/5-Functors.ipynb) - see Item 6 of \\cite{Meyers2001} or [this blog post](https://www.fluentcpp.com/2018/01/30/most-vexing-parse/) if you want to learn more about the reasons of this):"
]
},
{
......@@ -505,7 +505,7 @@
"source": [
"Please notice doing so doesn't prevent you to use the efficient initialization of `a_` in the constructor with arguments: the values thus provided in the data attributes definitions are used only in the constructor doesn't supersede them.\n",
"\n",
"In the same spirit, if you get pointers as data attributes it is a good idea to set them by default to `nullptr`: this way you may check with an [`assert`](/notebooks/5-UsefulConceptsAndSTL/1-ErrorHandling.ipynb#Assert) it has been correctly initialized before use."
"In the same spirit, if you get pointers as data attributes it is a good idea to set them by default to `nullptr`: this way you may check with an [`assert`](../5-UsefulConceptsAndSTL/1-ErrorHandling.ipynb#Assert) it has been correctly initialized before use."
]
},
{
......@@ -685,7 +685,10 @@
},
{
"cell_type": "markdown",
"metadata": {},
"metadata": {
"toc-hr-collapsed": true,
"toc-nb-collapsed": true
},
"source": [
"## Destructor\n",
"\n"
......@@ -823,7 +826,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"© _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)_"
]
......@@ -833,14 +836,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,
......@@ -875,5 +878,5 @@
}
},
"nbformat": 4,
"nbformat_minor": 2
"nbformat_minor": 4
}
......@@ -4,7 +4,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"# [Getting started in C++](/) - [Object programming](/notebooks/2-ObjectProgramming/0-main.ipynb) - [Encapsulation](/notebooks/2-ObjectProgramming/4-encapsulation.ipynb)"
"# [Getting started in C++](/) - [Object programming](./0-main.ipynb) - [Encapsulation](./4-encapsulation.ipynb)"
]
},
{
......@@ -71,9 +71,9 @@
"source": [
"The compiler informs you that a **private** constructor was called.\n",
"\n",
"In fact, in C++ you we may define the level of access of attributes with three levels (we'll let the third slip until the [chapter about inheritance](/notebooks/2-ObjectProgramming/6-inheritance.ipynb#Protected-status)):\n",
"In fact, in C++ you we may define the level of access of attributes with three levels (we'll let the third slip until the [chapter about inheritance](./6-inheritance.ipynb#Protected-status)):\n",
"\n",
"* **private** means only the member functions of the class are entitled to access it (and [friends](/notebooks/2-ObjectProgramming/4-encapsulation.ipynb#Friendship) as we shall see later in this notebook)\n",
"* **private** means only the member functions of the class are entitled to access it (and [friends](./4-encapsulation.ipynb#Friendship) as we shall see later in this notebook)\n",
"* **public** means everyone may access it.\n",
"\n",
"To determine which one is used, `public:` and `private:` may be added in a class declaration:"
......@@ -266,7 +266,7 @@
"{\n",
" public:\n",
" \n",
" MoreSecureRectangle(double length, double widgth);\n",
" MoreSecureRectangle(double length, double width);\n",
" void Print() const;\n",
"\n",
" private:\n",
......@@ -819,7 +819,7 @@
"Obviously, friendship should be used with parcimony... But it's not that much of a deal-breaker as it may seem:\n",
"\n",
"* The friendship must be defined in the class declaration. It means you can't use it to bypass a class encapsulation without modifying this code directly.\n",
"* The friendship is granted to a very specific function or class, and this class must be known when the class is defined. So an ill-intentioned user can't use the function prototype to sneak into your class private parts (in fact [forward declaration](/notebooks/6-InRealEnvironment/2-FileStructure.ipynb#Forward-declaration) is an exception to current statement)."
"* The friendship is granted to a very specific function or class, and this class must be known when the class is defined. So an ill-intentioned user can't use the function prototype to sneak into your class private parts (in fact [forward declaration](../6-InRealEnvironment/2-FileStructure.ipynb#Forward-declaration) is an exception to current statement)."
]
},
{
......@@ -836,7 +836,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"© _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)_"
]
......@@ -846,14 +846,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,
......@@ -888,5 +888,5 @@
}
},
"nbformat": 4,
"nbformat_minor": 2
"nbformat_minor": 4
}
......@@ -4,7 +4,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"# [Getting started in C++](/) - [Object programming](/notebooks/2-ObjectProgramming/0-main.ipynb) - [Static attributes](/notebooks/2-ObjectProgramming/5-static.ipynb)"
"# [Getting started in C++](/) - [Object programming](./0-main.ipynb) - [Static attributes](./5-static.ipynb)"
]
},
{
......@@ -23,9 +23,9 @@
"source": [
"## Static in C\n",
"\n",
"We haven't dealt yet with the keyword `static`, which exists in C. \n",
"We haven't dealt yet with the keyword `static`, which exists in C and could have been adressed in the procedural part of this lecture.\n",
"\n",
"As the C++ concept of **static method** uses up the same keyword and is not entirely related (even if both may be intertwined as we shall see in the [last section](/notebooks/2-ObjectProgramming/5-static.ipynb#Static-order-initialization-fiasco---and-its-fix)), we shall first review the C concept before studying the C++ one.\n",
"As the C++ concept of **static method** uses up the same keyword and is not entirely related (even if both may be intertwined as we shall see in the [last section](./5-static.ipynb#Static-order-initialization-fiasco---and-its-fix)), we shall first review the C concept before studying the C++ one.\n",
"\n",
"First of all, `static` may be seen as _at compile time_, whereas `dynamic` may be seen as _at runtime_.\n",
"\n",
......@@ -35,7 +35,7 @@
"* Static global variables are not visible outside of the C file they are defined in.\n",
"* Static functions are not visible outside of the C file they are defined in.\n",
"\n",
"Only the first one is really relevant in C++, as for quantities that should be accessible only in the current file C++ provides a concept of his own: the [**unnamed namespace**](/notebooks/6-InRealEnvironment/5-Namespace.ipynb#Unnamed-namespace).\n",
"Only the first one is really relevant in C++, as for quantities that should be accessible only in the current file C++ provides a concept of his own: the [**unnamed namespace**](../6-InRealEnvironment/5-Namespace.ipynb#Unnamed-namespace).\n",
"\n",
"Let's see the remaining case in action:\n",
"\n",
......@@ -54,7 +54,7 @@
"{\n",
" static int n = 0; // This initialisation occurs only at first call\n",
" // But `n` is not destroyed when the end bracket is reached and remains available\n",
" // in subsequent calls.\n",
" // in subsequent calls. However, `n` is available only inside this function.\n",
" std::cout << \"The function has been called \" << ++n << \" times.\" << std::endl; \n",
"}"
]
......@@ -449,7 +449,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"© _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)_"
]
......@@ -459,14 +459,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,
......@@ -501,5 +501,5 @@
}
},
"nbformat": 4,
"nbformat_minor": 2
"nbformat_minor": 4
}
......@@ -4,7 +4,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"# [Getting started in C++](/) - [Object programming](/notebooks/2-ObjectProgramming/0-main.ipynb) - [Inheritance and polymorphism](/notebooks/2-ObjectProgramming/6-inheritance.ipynb)"
"# [Getting started in C++](/) - [Object programming](./0-main.ipynb) - [Inheritance and polymorphism](./6-inheritance.ipynb)"
]
},
{
......@@ -375,7 +375,7 @@
"source": [
"So the language allows you to define this public relationship between `Rectangle` and `Square`, but you can see it is not a very bright idea... (this example is more detailed in item 32 of \\cite{Meyers2005}).\n",
"\n",
"Don't get me wrong: public inheritance is very handy, as we shall see more below with the introduction of polymorphism. It's just that you need to assess properly first what your needs are, and decide which is the more appropriate answer - and sometimes the most obvious one is not the better one.\n",
"Don't get me wrong: public inheritance is very handy, as we shall see more below with the introduction of polymorphism. It's just that you need to assess properly first what your needs are, and decide which is the more appropriate answer - and sometimes the most obvious one is not the best.\n",
"\n",
"The public inheritance is an application of the [Liskov substitution principe](https://en.wikipedia.org/wiki/Liskov_substitution_principle).\n",
"\n",
......@@ -384,7 +384,7 @@
"\n",
"### IS-IMPLEMENTED-IN-TERMS-OF relationship of private inheritance\n",
"\n",
"What you might look at in fact is for **private** inheritance, in which all the inherited attributes are considered private:"
"What you might look at in fact is **private** inheritance, in which all the inherited attributes are considered private:"
]
},
{
......@@ -448,7 +448,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"So this way, there is no assumption a `Square2` might pass any calls a `Rectangle` would accept.\n",
"So this way, there is no assumption a `Square2` might pass any call a `Rectangle` would accept.\n",
"\n",
"And of course the point is to avoid refining stuff and relying upon what was already implemented in the first class (it won't be impressive here but in other more complex cases it might prove extremely handy):"
]
......@@ -635,6 +635,8 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"### Private inheritance vs composition\n",
"\n",
"So what are the pros and cons of private inheritance and composition?\n",
" \n",
"- No granularity with private inheritance: you get all the interface available (privately) in the derived class. On the other hand, with composition you can choose which method you want to expose publicly in your new class (only Print() here).\n",
......@@ -984,11 +986,11 @@
"\n",
"* Static methods\n",
"* Constructors: no constructor can be virtual, and even more than that using a virtual method within a constructor won't work as expected.\n",
"* Methods with template arguments (we'll [come to that](/notebooks/4-Templates/1-Intro.ipynb#Function-templates-(or-methods))...)\n",
"* Methods with template arguments (we'll [come to that](../4-Templates/1-Intro.ipynb#Function-templates-(or-methods))...)\n",
"\n",
"That means even the destructor may be virtual (we'll go back to that as well...).\n",
"That means even the destructor may be virtual (and probably should - we'll go back to that as well...).\n",
"\n",
"I will also introduce and explain **override** after the example,"
"I will also introduce **override** keyword, that will be explained after the example:"
]
},
{
......@@ -1070,7 +1072,7 @@
"\n",
"* **virtual** should be only declared; it is not repeated in the method definition. Adding it there is a compilation error!\n",
"* Same for **override** (see explanation for this one below)\n",
"* **virtual** keyword is mandatory only in the base class. I advise to write it in the derived classes, but it is not a language requirement.\n",
"* **virtual** keyword is mandatory only in the base class declaration. I advise to write it in the derived classes, but it is not a language requirement.\n",
"* Prior to C++ 11, there was the risk you make a mistake in the exact prototype; for instance the following implementation would be valid and accepted both by the compiler and at runtime (but don't expect the correct behaviour!):\n",
"\n",
"### `override` qualifier"
......@@ -1749,7 +1751,7 @@
"So to put in a nutshell, 99 % of the time:\n",
"\n",
"* If a class of yours is intended to be inherited from, make its destructor virtual.\n",
"* If not, mark it as final."
"* If not, mark it as final.\n"
]
},
{
......@@ -1839,9 +1841,9 @@
"outputs": [],
"source": [
"{\n",
" DerivedClass4 object; // nope by stack allocation\n",
" DerivedClass4 object; // not working by stack allocation...\n",
" \n",
" DerivedClass4* object2 = new DerivedClass4; // same by heap allocation\n",
" DerivedClass4* object2 = new DerivedClass4; // neither by heap allocation!\n",
"}"
]
},
......@@ -1960,7 +1962,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"© _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)_"
]
......@@ -1970,14 +1972,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,
......@@ -2017,5 +2019,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