cpp-partie-2/cpp08/ex02/MutantStack.hpp
Ladebeze66 8a57eedbd6 cp08
2024-03-13 15:06:56 +01:00

54 lines
1.9 KiB
C++

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* MutantStack.hpp :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: fgras-ca <fgras-ca@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/03/03 18:22:10 by fgras-ca #+# #+# */
/* Updated: 2024/03/13 14:27:38 by fgras-ca ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef MUTANTSTACK_HPP
#define MUTANTSTACK_HPP
#include <stack>
#include <iostream>
#include <deque>
#define RESET "\033[0m"
#define BLACK "\033[30m"
#define RED "\033[31m"
#define GREEN "\033[32m"
#define YELLOW "\033[33m"
#define BLUE "\033[34m"
#define MAGENTA "\033[35m"
#define CYAN "\033[36m"
#define WHITE "\033[37m"
#define ORANGE "\033[38;5;214m"
template<typename T, typename Container = std::deque<T> >
class MutantStack : public std::stack<T, Container>
{
public:
MutantStack(); // Constructeur par défaut
MutantStack(const MutantStack& other); // Constructeur de copie
~MutantStack(); // Destructeur
MutantStack& operator=(const MutantStack& other); // Opérateur d'assignation
typedef typename Container::iterator iterator;
typedef typename Container::const_iterator const_iterator;
iterator begin();
iterator end();
const_iterator begin() const;
const_iterator end() const;
private:
using std::stack<T, Container>::c; // Utilisez 'c' pour accéder au conteneur sous-jacent
};
#include "MutantStack.tpp"
#endif