Commit 98935baf authored by CHAMONT David's avatar CHAMONT David
Browse files

Upgrade videos, adn some coding style.

parent 4684ad1f
......@@ -139,10 +139,10 @@
"class ParticleGuard\n",
" {\n",
" public :\n",
" ParticleGuard( Particle * p ) : p_(p) {}\n",
" ~ParticleGuard() { delete p_ ; }\n",
" ParticleGuard( Particle * p ) : m_p(p) {}\n",
" ~ParticleGuard() { delete m_p ; }\n",
" private :\n",
" Particle * p_ ;\n",
" Particle * m_p ;\n",
" } ;\n",
"//...\n",
"void f()\n",
......@@ -214,11 +214,11 @@
"class ParticleGuard\n",
" {\n",
" public:\n",
" ParticleGuard( Particle * p ) : p_{p} {}\n",
" Particle & get() { return *p_ ; }\n",
" ~ParticleGuard() { delete p_ ; }\n",
" ParticleGuard( Particle * p ) : m_p{p} {}\n",
" Particle & get() { return *m_p ; }\n",
" ~ParticleGuard() { delete m_p ; }\n",
" private:\n",
" Particle * p_ ;\n",
" Particle * m_p ;\n",
" } ;\n",
"\n",
"void f()\n",
......@@ -245,11 +245,11 @@
"class ParticleGuard\n",
" {\n",
" public:\n",
" ParticleGuard( Particle * p ) : p_{p} {}\n",
" operator Particle &() { return *p_ ; }\n",
" ~ParticleGuard() { delete p_ ; }\n",
" ParticleGuard( Particle * p ) : m_p{p} {}\n",
" operator Particle &() { return *m_p ; }\n",
" ~ParticleGuard() { delete m_p ; }\n",
" private:\n",
" Particle * p_ ;\n",
" Particle * m_p ;\n",
" } ;\n",
"\n",
"void f()\n",
......@@ -331,44 +331,44 @@
" public:\n",
" \n",
" ParticleGuard( Particle * p ) // acquire resource\n",
" : bloc_(new Particularization(p))\n",
" : m_bloc(new Particularization(p))\n",
" {} \n",
"\n",
" ParticleGuard( ParticleGuard const & pg )\n",
" : bloc_(pg.bloc_)\n",
" { bloc_->nb_ += 1 ; } \n",
" : m_bloc(pg.m_bloc)\n",
" { m_bloc->m_nb += 1 ; } \n",
"\n",
" ParticleGuard & operator=( ParticleGuard const & pg )\n",
" {\n",
" if (this==&pg) return *this ;\n",
" bloc_->nb_ -= 1 ;\n",
" if (bloc_->nb_==0)\n",
" delete bloc_ ;\n",
" bloc_ = pg.bloc_ ;\n",
" bloc_->nb_ += 1 ;\n",
" m_bloc->m_nb -= 1 ;\n",
" if (m_bloc->m_nb==0)\n",
" delete m_bloc ;\n",
" m_bloc = pg.m_bloc ;\n",
" m_bloc->m_nb += 1 ;\n",
" return *this ;\n",
" } \n",
"\n",
" operator Particle &() { return *bloc_->p_ ; }\n",
" operator Particle &() { return *m_bloc->m_p ; }\n",
"\n",
" ~ParticleGuard() // release resource\n",
" {\n",
" bloc_->nb_ -= 1 ;\n",
" if (bloc_->nb_==0)\n",
" delete bloc_ ;\n",
" m_bloc->m_nb -= 1 ;\n",
" if (m_bloc->m_nb==0)\n",
" delete m_bloc ;\n",
" } \n",
"\n",
" private :\n",
" \n",
" struct Particularization\n",
" {\n",
" Particularization( Particle * p ) : p_(p) {}\n",
" ~Particularization() { delete p_ ; }\n",
" unsigned int nb_{1} ;\n",
" Particle * p_ ;\n",
" Particularization( Particle * p ) : m_p(p) {}\n",
" ~Particularization() { delete m_p ; }\n",
" unsigned int m_nb{1} ;\n",
" Particle * m_p ;\n",
" } ;\n",
" \n",
" Particularization * bloc_ ;\n",
" Particularization * m_bloc ;\n",
" \n",
" } ;\n",
"\n",
......@@ -408,9 +408,9 @@
" public :\n",
" //...\n",
" ParticleGuard( ParticleGuard const & pg )\n",
" { p_ = pg.p_->clone() ; }\n",
" { m_p = pg.m_p->clone() ; }\n",
" ParticleGuard & operator=( ParticleGuard const & pg )\n",
" { delete p_ ; p_ = pg.p_->clone() ; return *this ; }\n",
" { delete m_p ; m_p = pg.m_p->clone() ; return *this ; }\n",
" //...\n",
" } ;\n",
"```"
......@@ -430,9 +430,9 @@
" public :\n",
" //...\n",
" ParticleGuard( ParticleGuard const & pg )\n",
" { p_ = pg.p_ ; pg.p_ = nullptr ; }\n",
" { m_p = pg.m_p ; pg.m_p = nullptr ; }\n",
" ParticleGuard & operator=( ParticleGuard const & pg )\n",
" { delete p_ ; p_ = pg.p_ ; pg.p_ = nullptr ; }\n",
" { delete m_p ; m_p = pg.m_p ; pg.m_p = nullptr ; }\n",
" //...\n",
" } ;\n",
"```"
......
......@@ -658,20 +658,20 @@
"source": [
"struct Neuron \n",
" {\n",
" int id_ ;\n",
" std::vector<std::weak_ptr<Neuron>> connexions_ ;\n",
" int m_id ;\n",
" std::vector<std::weak_ptr<Neuron>> m_connexions ;\n",
" \n",
" explicit Neuron( int id ) : id_(id)\n",
" { std::cout<<\"Neuron's construction \"<<id_<<std::endl ; }\n",
" explicit Neuron( int id ) : m_id(id)\n",
" { std::cout<<\"Neuron's construction \"<<m_id<<std::endl ; }\n",
" ~Neuron()\n",
" { std::cout<<\"Neuron's destruction \"<<id_<<std::endl ; }\n",
" { std::cout<<\"Neuron's destruction \"<<m_id<<std::endl ; }\n",
" friend std::ostream & operator<<( std::ostream & os, Neuron const & n )\n",
" {\n",
" os<<\"neuron \"<<n.id_<<\", lié à\" ;\n",
" for ( auto c : n.connexions_ )\n",
" os<<\"neuron \"<<n.m_id<<\", lié à\" ;\n",
" for ( auto c : n.m_connexions )\n",
" {\n",
" auto p = c.lock() ;\n",
" if (p) os<<\" \"<<p->id_ ;\n",
" if (p) os<<\" \"<<p->m_id ;\n",
" }\n",
" return os ;\n",
" }\n",
......@@ -702,8 +702,8 @@
" // connecte\n",
" for ( auto n1 : v )\n",
" for ( auto const & n2 : v )\n",
" if ( n1->id_ != n2->id_ )\n",
" { n1->connexions_.push_back(std::weak_ptr<Neuron>(n2)) ; } \n",
" if ( n1->m_id != n2->m_id )\n",
" { n1->m_connexions.push_back(std::weak_ptr<Neuron>(n2)) ; } \n",
"\n",
" // inspecte\n",
" for ( auto neuron : v )\n",
......
......@@ -29,33 +29,33 @@
"public :\n",
" Texte( char const * str )\n",
" {\n",
" taille_ = std::strlen(str)+1 ;\n",
" donnees_ = new char [taille_] ;\n",
" std::copy(str,str+taille_,donnees_) ;\n",
" m_taille = std::strlen(str)+1 ;\n",
" m_donnees = new char [m_taille] ;\n",
" std::copy(str,str+m_taille,m_donnees) ;\n",
" }\n",
" Texte( Texte const & t )\n",
" : taille_(t.taille_), donnees_(new char [t.taille_])\n",
" : m_taille(t.m_taille), m_donnees(new char [t.m_taille])\n",
" {\n",
" std::cout<<\"new & deep copy\"<<std::endl ;\n",
" std::copy(t.donnees_,t.donnees_+taille_,donnees_) ;\n",
" std::copy(t.m_donnees,t.m_donnees+m_taille,m_donnees) ;\n",
" }\n",
" Texte & operator=( Texte const & t )\n",
" {\n",
" if (this == &t) return *this ;\n",
" std::cout<<\"delete, new & deep copy\"<<std::endl ;\n",
" delete [] donnees_ ;\n",
" taille_ = t.taille_ ;\n",
" donnees_ = new char [t.taille_] ;\n",
" std::copy(t.donnees_,t.donnees_+taille_,donnees_) ;\n",
" delete [] m_donnees ;\n",
" m_taille = t.m_taille ;\n",
" m_donnees = new char [t.m_taille] ;\n",
" std::copy(t.m_donnees,t.m_donnees+m_taille,m_donnees) ;\n",
" return *this ;\n",
" }\n",
" ~Texte()\n",
" { delete [] donnees_ ; }\n",
" { delete [] m_donnees ; }\n",
" friend std::ostream & operator<<( std::ostream & os, Texte const & t )\n",
" { return os<<t.donnees_ ; }\n",
" { return os<<t.m_donnees ; }\n",
"private :\n",
" unsigned int taille_ {0} ;\n",
" char * donnees_ {nullptr} ;\n",
" unsigned int m_taille {0} ;\n",
" char * m_donnees {nullptr} ;\n",
"} ;"
]
},
......@@ -105,44 +105,44 @@
"public :\n",
" TexteEchangeable( char const * str )\n",
" {\n",
" taille_ = std::strlen(str)+1 ;\n",
" donnees_ = new char [taille_] ;\n",
" std::copy(str,str+taille_,donnees_) ;\n",
" m_taille = std::strlen(str)+1 ;\n",
" m_donnees = new char [m_taille] ;\n",
" std::copy(str,str+m_taille,m_donnees) ;\n",
" }\n",
" TexteEchangeable( TexteEchangeable const & t )\n",
" : taille_(t.taille_), donnees_(new char [t.taille_])\n",
" : m_taille(t.m_taille), m_donnees(new char [t.m_taille])\n",
" {\n",
" std::cout<<\"new & deep copy\"<<std::endl ;\n",
" std::copy(t.donnees_,t.donnees_+taille_,donnees_) ;\n",
" std::copy(t.m_donnees,t.m_donnees+m_taille,m_donnees) ;\n",
" }\n",
" TexteEchangeable & operator=( TexteEchangeable const & t )\n",
" {\n",
" if (this == &t) return *this ;\n",
" std::cout<<\"delete, new & deep copy\"<<std::endl ;\n",
" delete [] donnees_ ;\n",
" taille_ = t.taille_ ;\n",
" donnees_ = new char [t.taille_] ;\n",
" std::copy(t.donnees_,t.donnees_+taille_,donnees_) ;\n",
" delete [] m_donnees ;\n",
" m_taille = t.m_taille ;\n",
" m_donnees = new char [t.m_taille] ;\n",
" std::copy(t.m_donnees,t.m_donnees+m_taille,m_donnees) ;\n",
" return *this ;\n",
" }\n",
" void echange( TexteEchangeable & t )\n",
" { \n",
" if (this == &t) return *this ;\n",
" std::cout<<\"no delete, no new & shallow copy\"<<std::endl ;\n",
" unsigned int taille_tmp = taille_ ;\n",
" char * donnees_tmp = donnees_ ;\n",
" taille_ = t.taille_ ;\n",
" donnees_ = t.donnees_ ;\n",
" t.taille_ = taille_tmp ;\n",
" t.donnees_ = donnees_tmp ;\n",
" unsigned int taille_tmp = m_taille ;\n",
" char * donnees_tmp = m_donnees ;\n",
" m_taille = t.m_taille ;\n",
" m_donnees = t.m_donnees ;\n",
" t.m_taille = taille_tmp ;\n",
" t.m_donnees = donnees_tmp ;\n",
" }\n",
" ~TexteEchangeable()\n",
" { delete [] donnees_ ; }\n",
" { delete [] m_donnees ; }\n",
" friend std::ostream & operator<<( std::ostream & os, TexteEchangeable const & t )\n",
" { return os<<t.donnees_ ; }\n",
" { return os<<t.m_donnees ; }\n",
"private :\n",
" unsigned int taille_ {0} ;\n",
" char * donnees_ {nullptr} ;\n",
" unsigned int m_taille {0} ;\n",
" char * m_donnees {nullptr} ;\n",
"} ;"
]
},
......@@ -493,14 +493,14 @@
"class A\n",
"{\n",
"private:\n",
" int * data_ ;\n",
" int * m_data ;\n",
"public :\n",
" A(): data_(new int[1000000]) {}\n",
" A( A const & other ) : data_(new int[1000000])\n",
" { std::copy(other.data_,other.data_+1000000,data_) ; }\n",
" A( A && other ) : data_(other.data_)\n",
" { other.data_ = nullptr ; }\n",
" ~A() { delete [] data_; }\n",
" A(): m_data(new int[1000000]) {}\n",
" A( A const & other ) : m_data(new int[1000000])\n",
" { std::copy(other.m_data,other.m_data+1000000,m_data) ; }\n",
" A( A && other ) : m_data(other.m_data)\n",
" { other.m_data = nullptr ; }\n",
" ~A() { delete [] m_data; }\n",
"} ;"
]
},
......@@ -549,33 +549,33 @@
"public :\n",
" Texte( char const * str )\n",
" {\n",
" taille_ = std::strlen(str)+1 ;\n",
" donnees_ = new char [taille_] ;\n",
" std::copy(str,str+taille_,donnees_) ;\n",
" m_taille = std::strlen(str)+1 ;\n",
" m_donnees = new char [m_taille] ;\n",
" std::copy(str,str+m_taille,m_donnees) ;\n",
" }\n",
" Texte( Texte const & t )\n",
" : taille_(t.taille_), donnees_(new char [t.taille_])\n",
" : m_taille(t.m_taille), m_donnees(new char [t.m_taille])\n",
" {\n",
" std::cout<<\"creation par copie\"<<std::endl ;\n",
" std::copy(t.donnees_,t.donnees_+taille_,donnees_) ;\n",
" std::copy(t.m_donnees,t.m_donnees+m_taille,m_donnees) ;\n",
" }\n",
" Texte & operator=( Texte const & t )\n",
" {\n",
" std::cout<<\"affectation par copie\"<<std::endl ;\n",
" if (this == &t) return *this ;\n",
" delete [] donnees_ ;\n",
" taille_ = t.taille_ ;\n",
" donnees_ = new char [t.taille_] ;\n",
" std::copy(t.donnees_,t.donnees_+taille_,donnees_) ;\n",
" delete [] m_donnees ;\n",
" m_taille = t.m_taille ;\n",
" m_donnees = new char [t.m_taille] ;\n",
" std::copy(t.m_donnees,t.m_donnees+m_taille,m_donnees) ;\n",
" return *this ;\n",
" }\n",
" ~Texte()\n",
" { delete [] donnees_ ; }\n",
" { delete [] m_donnees ; }\n",
" friend std::ostream & operator<<( std::ostream & os, Texte const & t )\n",
" { return os<<t.donnees_ ; }\n",
" { return os<<t.m_donnees ; }\n",
"private :\n",
" unsigned int taille_ {0} ;\n",
" char * donnees_ {nullptr} ;\n",
" unsigned int m_taille {0} ;\n",
" char * m_donnees {nullptr} ;\n",
"} ;"
]
},
......@@ -690,51 +690,51 @@
"public :\n",
" TexteDeplacable( char const * str )\n",
" {\n",
" taille_ = std::strlen(str)+1 ;\n",
" donnees_ = new char [taille_] ;\n",
" std::copy(str,str+taille_,donnees_) ;\n",
" m_taille = std::strlen(str)+1 ;\n",
" m_donnees = new char [m_taille] ;\n",
" std::copy(str,str+m_taille,m_donnees) ;\n",
" }\n",
" TexteDeplacable( TexteDeplacable const & t )\n",
" : taille_(t.taille_), donnees_(new char [t.taille_])\n",
" : m_taille(t.m_taille), m_donnees(new char [t.m_taille])\n",
" {\n",
" std::cout<<\"construction par copie\"<<std::endl ;\n",
" std::copy(t.donnees_,t.donnees_+taille_,donnees_) ;\n",
" std::copy(t.m_donnees,t.m_donnees+m_taille,m_donnees) ;\n",
" }\n",
" TexteDeplacable( TexteDeplacable && t )\n",
" : taille_(t.taille_), donnees_(t.donnees_)\n",
" : m_taille(t.m_taille), m_donnees(t.m_donnees)\n",
" {\n",
" std::cout<<\"construction par déplacement\"<<std::endl ;\n",
" t.taille_ = 0 ;\n",
" t.donnees_ = nullptr ;\n",
" t.m_taille = 0 ;\n",
" t.m_donnees = nullptr ;\n",
" }\n",
" TexteDeplacable & operator=( TexteDeplacable const & t )\n",
" {\n",
" std::cout<<\"affectation par copie\"<<std::endl ;\n",
" if (this == &t) return *this ;\n",
" delete [] donnees_ ;\n",
" taille_ = t.taille_ ;\n",
" donnees_ = new char [t.taille_] ;\n",
" std::copy(t.donnees_,t.donnees_+taille_,donnees_) ;\n",
" delete [] m_donnees ;\n",
" m_taille = t.m_taille ;\n",
" m_donnees = new char [t.m_taille] ;\n",
" std::copy(t.m_donnees,t.m_donnees+m_taille,m_donnees) ;\n",
" return *this ;\n",
" }\n",
" TexteDeplacable & operator=( TexteDeplacable && t )\n",
" {\n",
" std::cout<<\"affectation par déplacement\"<<std::endl ;\n",
" if (this == &t) return *this ;\n",
" delete [] donnees_ ;\n",
" taille_ = t.taille_ ;\n",
" donnees_ = t.donnees_ ;\n",
" t.taille_ = 0 ;\n",
" t.donnees_ = nullptr ;\n",
" delete [] m_donnees ;\n",
" m_taille = t.m_taille ;\n",
" m_donnees = t.m_donnees ;\n",
" t.m_taille = 0 ;\n",
" t.m_donnees = nullptr ;\n",
" return *this ;\n",
" }\n",
" ~TexteDeplacable()\n",
" { delete [] donnees_ ; }\n",
" { delete [] m_donnees ; }\n",
" friend std::ostream & operator<<( std::ostream & os, TexteDeplacable const & t )\n",
" { return os<<t.donnees_ ; }\n",
" { return os<<t.m_donnees ; }\n",
"private :\n",
" unsigned int taille_ {0} ;\n",
" char * donnees_ {nullptr} ;\n",
" unsigned int m_taille {0} ;\n",
" char * m_donnees {nullptr} ;\n",
"} ;"
]
},
......
......@@ -142,10 +142,10 @@
"class ParticleGuard\n",
" {\n",
" public :\n",
" ParticleGuard( Particle * p ) : p_(p) {}\n",
" ~ParticleGuard() { delete p_ ; }\n",
" ParticleGuard( Particle * p ) : m_p(p) {}\n",
" ~ParticleGuard() { delete m_p ; }\n",
" private :\n",
" Particle * p_ ;\n",
" Particle * m_p ;\n",
" } ;\n",
"//...\n",
"void f()\n",
......@@ -217,11 +217,11 @@
"class ParticleGuard\n",
" {\n",
" public:\n",
" ParticleGuard( Particle * p ) : p_{p} {}\n",
" Particle & get() { return *p_ ; }\n",
" ~ParticleGuard() { delete p_ ; }\n",
" ParticleGuard( Particle * p ) : m_p{p} {}\n",
" Particle & get() { return *m_p ; }\n",
" ~ParticleGuard() { delete m_p ; }\n",
" private:\n",
" Particle * p_ ;\n",
" Particle * m_p ;\n",
" } ;\n",
"\n",
"void f()\n",
......@@ -248,11 +248,11 @@
"class ParticleGuard\n",
" {\n",
" public:\n",
" ParticleGuard( Particle * p ) : p_{p} {}\n",
" operator Particle &() { return *p_ ; }\n",
" ~ParticleGuard() { delete p_ ; }\n",
" ParticleGuard( Particle * p ) : m_p{p} {}\n",
" operator Particle &() { return *m_p ; }\n",
" ~ParticleGuard() { delete m_p ; }\n",
" private:\n",
" Particle * p_ ;\n",
" Particle * m_p ;\n",
" } ;\n",
"\n",
"void f()\n",
......@@ -334,44 +334,44 @@
" public:\n",
" \n",
" ParticleGuard( Particle * p ) // acquire resource\n",
" : bloc_(new ParticleControlBloc(p))\n",
" : m_bloc(new ParticleControlBloc(p))\n",
" {} \n",
"\n",
" ParticleGuard( ParticleGuard const & pg )\n",
" : bloc_(pg.bloc_)\n",
" { bloc_->nb_ += 1 ; } \n",
" : m_bloc(pg.m_bloc)\n",
" { m_bloc->m_nb += 1 ; } \n",
"\n",
" ParticleGuard & operator=( ParticleGuard const & pg )\n",
" {\n",
" if (this==&pg) return *this ;\n",
" bloc_->nb_ -= 1 ;\n",
" if (bloc_->nb_==0)\n",
" delete bloc_ ;\n",
" bloc_ = pg.bloc_ ;\n",
" bloc_->nb_ += 1 ;\n",
" m_bloc->m_nb -= 1 ;\n",
" if (m_bloc->m_nb==0)\n",
" delete m_bloc ;\n",
" m_bloc = pg.m_bloc ;\n",
" m_bloc->m_nb += 1 ;\n",
" return *this ;\n",
" } \n",
"\n",
" operator Particle &() { return *bloc_->p_ ; }\n",
" operator Particle &() { return *m_bloc->m_p ; }\n",
"\n",
" ~ParticleGuard() // release resource\n",
" {\n",
" bloc_->nb_ -= 1 ;\n",
" if (bloc_->nb_==0)\n",
" delete bloc_ ;\n",
" m_bloc->m_nb -= 1 ;\n",
" if (m_bloc->m_nb==0)\n",
" delete m_bloc ;\n",
" } \n",
"\n",
" private :\n",
" \n",
" struct ParticleControlBloc\n",
" {\n",
" ParticleControlBloc( Particle * p ) : p_(p) {}\n",
" ~ParticleControlBloc() { delete p_ ; }\n",
" unsigned int nb_{1} ;\n",
" Particle * p_ ;\n",
" ParticleControlBloc( Particle * p ) : m_p(p) {}\n",
" ~ParticleControlBloc() { delete m_p ; }\n",
" unsigned int m_nb{1} ;\n",
" Particle * m_p ;\n",
" } ;\n",
" \n",
" ParticleControlBloc * bloc_ ;\n",
" ParticleControlBloc * m_bloc ;\n",
" \n",
" } ;\n",
"\n",
......@@ -411,9 +411,9 @@
" public :\n",
" //...\n",
" ParticleGuard( ParticleGuard const & pg )\n",
" { p_ = pg.p_->clone() ; }\n",
" { m_p = pg.m_p->clone() ; }\n",
" ParticleGuard & operator=( ParticleGuard const & pg )\n",
" { delete p_ ; p_ = pg.p_->clone() ; return *this ; }\n",
" { delete m_p ; m_p = pg.m_p->clone() ; return *this ; }\n",
" //...\n",
" } ;\n",
"```"
......@@ -433,9 +433,9 @@
" public :\n",
" //...\n",
" ParticleGuard( ParticleGuard const & pg )\n",
" { p_ = pg.p_ ; pg.p_ = nullptr ; }\n",
" { m_p = pg.m_p ; pg.m_p = nullptr ; }\n",
" ParticleGuard & operator=( ParticleGuard const & pg )\n",
" { delete p_ ; p_ = pg.p_ ; pg.p_ = nullptr ; }\n",
" { delete m_p ; m_p = pg.m_p ; pg.m_p = nullptr ; }\n",
" //...\n",
" } ;\n",
"```"
......
......@@ -658,20 +658,20 @@
"source": [
"struct Neurone \n",
" {\n",
" int id_ ;\n",
" std::vector<std::weak_ptr<Neurone>> connexions_ ;\n",
" int m_id ;\n",
" std::vector<std::weak_ptr<Neurone>> m_connexions ;\n",
" \n",
" explicit Neurone( int id ) : id_(id)\n",
" { std::cout<<\"Construction du neurone \"<<id_<<std::endl ; }\n",
" explicit Neurone( int id ) : m_id(id)\n",
" { std::cout<<\"Construction du neurone \"<<m_id<<std::endl ; }\n",
" ~Neurone()\n",
" { std::cout<<\"Destruction du neurone \"<<id_<<std::endl ; }\n",
" { std::cout<<\"Destruction du neurone \"<<m_id<<std::endl ; }\n",
" friend std::ostream & operator<<( std::ostream & os, Neurone const & n )\n",
" {\n",
" os<<\"neurone \"<<n.id_<<\", lié à\" ;\n",
" for ( auto c : n.connexions_ )\n",
" os<<\"neurone \"<<n.m_id<<\", lié à\" ;\n",
" for ( auto c : n.m_connexions )\n",
" {\n",
" auto p = c.lock() ;\n",
" if (p) os<<\" \"<<p->id_ ;\n",
" if (p) os<<\" \"<<p->m_id ;\n",
" }\n",
" return os ;\n",
" }\n",
......@@ -702,8 +702,8 @@
" // connecte\n",
" for ( auto n1 : v )\n",
" for ( auto const & n2 : v )\n",
" if ( n1->id_ != n2->id_ )\n",
" { n1->connexions_.push_back(std::weak_ptr<Neurone>(n2)) ; } \n",
" if ( n1->m_id != n2->m_id )\n",
" { n1->m_connexions.push_back(std::weak_ptr<Neurone>(n2)) ; } \n",
"\n",
" // inspecte\n",
" for ( auto neurone : v )\n",
......
#include <type_traits>
template< typename T >
using my_remove_const_t = typename std::remove_const<T>::type ;
......
......@@ -233,7 +233,7 @@
}
},
"source": [
"Before C++17, when asking for the instanciation of a templated class, the developer had to provide explicitly the template parameters, although they were often quite obvious (see example below). This often leaded to the definition of `make_*` utility functions, whose only purpose was to allow the parameter deduction by the compiler. "
"Before C++17, when asking for the instanciation of a templated class, the developer had to provide explicitly the template parameters, although they were often quite obvious (see example below). This often leaded to the definition of `m_make*` utility functions, whose only purpose was to allow the parameter deduction by the compiler. "
]
},
{
......
......@@ -291,9 +291,9 @@
"class Point2d\n",
" {\n",