lab.cpp/ex5/Duree.h

36 lines
585 B
C
Raw Permalink Normal View History

2016-03-06 16:29:02 +00:00
#ifndef DEF_DUREE
#define DEF_DUREE
#include <iostream>
#include <string>
using namespace std;
class Duree{
public:
Duree(int h=0, int m=0, int s=0);
Duree(const Duree& d);
bool operator==(const Duree& x);
void operator+=(const Duree& d);
void operator*=(const int d);
private:
int _h;
int _m;
int _s;
void fix();
friend ostream& operator<<(ostream& o, const Duree& d);
};
// Operateurs binaires
Duree operator+(Duree& l, Duree& r);
Duree operator*(int l, Duree& r);
Duree operator*(Duree& l, int r);
#include "Duree.cpp"
#endif