Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class seconds_t
- {
- protected:
- std::chrono::duration<double, std::chrono::seconds::period> value;
- public:
- operator std::string() const;
- };
- seconds_t::operator std::string() const
- {
- return std::to_string(value.count());
- }
- const seconds_t t1 = 11.2; // задал double - перевелось в секунды
- const seconds_t t2 = 2h; // задал через суффиксы времени
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement