This repository has been archived on 2023-05-13. You can view files and clone it, but cannot push or open issues or pull requests.
mipt_cpp/seminar04_templates/04_time/time.h
2022-11-02 23:17:06 +03:00

21 lines
556 B
C++

#pragma once
#include <string_view>
#include <iostream>
#include <vector>
using std::string_view, std::vector;
class Time {
private:
int mHours = 0, mMinutes = 0, mSeconds = 0;
public:
Time(int hours, int minutes, int seconds);
Time();
Time(string_view s);
Time operator+(Time b) const;
int hours() const; int minutes() const; int seconds() const;
friend std::ostream& operator<<(std::ostream& out, Time t);
};
Time sumTimes(const vector<Time>& v);
vector<Time> getTimesFromString(string_view s);