/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* MutantStack.tpp :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: fgras-ca +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/03/03 18:23:49 by fgras-ca #+# #+# */ /* Updated: 2024/03/13 13:49:40 by fgras-ca ### ########.fr */ /* */ /* ************************************************************************** */ // Constructeur par défaut template MutantStack::MutantStack() : std::stack() { std::cout << GREEN << "MutantStack constructor called!" << RESET << std::endl; } // Constructeur de copie template MutantStack::MutantStack(const MutantStack& other) : std::stack(other) { std::cout << CYAN << "Copy constructor called for MutantStack." << RESET << std::endl; } // Destructeur template MutantStack::~MutantStack() { std::cout << RED << "MutantStack is destroyed!" << RESET << std::endl; } // Opérateur d'assignation template MutantStack& MutantStack::operator=(const MutantStack& other) { std::cout << "Copy assignment MutantStack operator called" << std::endl; if (this != &other) { std::stack::operator=(other); } return (*this); } // Début de l'itérateur template typename MutantStack::iterator MutantStack::begin() { return (this->c.begin()); } // Fin de l'itérateur template typename MutantStack::iterator MutantStack::end() { return (this->c.end()); } // Début de l'itérateur constant template typename MutantStack::const_iterator MutantStack::begin() const { return (this->c.begin()); } // Fin de l'itérateur constant template typename MutantStack::const_iterator MutantStack::end() const { return (this->c.end()); }