35 lines
622 B
C++
35 lines
622 B
C++
#pragma once
|
|
|
|
#define EXERCISM_RUN_ALL_TESTS
|
|
|
|
#include <string>
|
|
|
|
namespace date_independent {
|
|
|
|
typedef long total_t;
|
|
typedef short hours_t;
|
|
typedef short minutes_t;
|
|
|
|
|
|
class clock
|
|
{
|
|
total_t total_minutes_;
|
|
|
|
public:
|
|
|
|
clock(hours_t hours = 0, minutes_t minutes = 0);
|
|
clock(const clock&) = default;
|
|
clock &operator=(const clock&) = default;
|
|
|
|
bool operator==(const clock&) const;
|
|
bool operator!=(const clock&) const;
|
|
|
|
static clock at(hours_t hours, minutes_t minutes = 0);
|
|
|
|
clock plus(minutes_t minutes) const;
|
|
clock minus(minutes_t minutes) const;
|
|
|
|
operator std::string() const;
|
|
};
|
|
|
|
}
|