d04 ex01 en grande partie fait mais segfault qqpart
This commit is contained in:
@@ -1,15 +1,19 @@
|
||||
#include "Animal.hpp"
|
||||
|
||||
#define COPLIEN_COLOR B_CYAN
|
||||
|
||||
/*********************************************
|
||||
* CONSTRUCTORS
|
||||
*********************************************/
|
||||
|
||||
Animal::Animal() {
|
||||
std::cout << COPLIEN_COLOR "Animal constructor" RESET "\n";
|
||||
type = "animal";
|
||||
return;
|
||||
}
|
||||
|
||||
Animal::Animal( Animal const & src ) {
|
||||
std::cout << COPLIEN_COLOR "Animal copy constructor" RESET "\n";
|
||||
*this = src;
|
||||
return;
|
||||
}
|
||||
@@ -19,6 +23,7 @@ Animal::Animal( Animal const & src ) {
|
||||
*********************************************/
|
||||
|
||||
Animal::~Animal() {
|
||||
std::cout << COPLIEN_COLOR "Animal destructor" RESET "\n";
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -27,6 +32,7 @@ Animal::~Animal() {
|
||||
*********************************************/
|
||||
|
||||
Animal & Animal::operator=( Animal const & rhs ) {
|
||||
std::cout << COPLIEN_COLOR "Animal assignator" RESET "\n";
|
||||
if ( this != &rhs )
|
||||
{
|
||||
type = rhs.getType();
|
||||
|
||||
Reference in New Issue
Block a user