Skip to content

Change std::chrono::milliseconds parameters to templated parameter #308

@jbaldwin

Description

@jbaldwin

Functions that take arguments like:

auto func(std::chrono::milliseconds timeout) -> coro::task<void>

Should instead be like:

template<class rep, class period>
auto func(const std::chrono::duration<rep, period>& timeout) -> coro::task<void>

This should be more flexible from a using standpoint, but possibly will cause more template compile times, I think this is the right call though since this is a more generic library and forcing std::chrono::milliseconds doesn't seem right.

The same can be done for any time point:

template<class clock, class duration>
auto func(const std::chrono::time_point<clock, duration> timepoint) -> coro::task<void>

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions