state of task

This commit is contained in:
Mylloon 2023-10-21 15:50:27 +02:00
parent 477f73d4c4
commit a964d703fc
Signed by: Anri
GPG key ID: A82D63DFF8D1317F
2 changed files with 5 additions and 2 deletions

View file

@ -4,7 +4,10 @@
#include <iostream>
class Tache {
enum Etat { EnAttente, Realisee };
static int unique_id;
enum Etat etat;
friend std::ostream &operator<<(std::ostream &, const Tache &);

View file

@ -2,7 +2,7 @@
int Tache::unique_id = 0;
Tache::Tache() {
Tache::Tache() : etat(EnAttente) {
++unique_id;
std::cout << "Hello, tache!\n";
@ -10,7 +10,7 @@ Tache::Tache() {
Tache::~Tache() { --unique_id; }
Tache::Tache(const Tache &) { ++unique_id; }
Tache::Tache(const Tache &src) : etat(src.etat) { ++unique_id; }
const Tache &Tache::operator=(const Tache &src) {
if (this == &src) {