Skip to content

Glossary: Software Design Patterns in C++

Injected clock

Also written: clock, Clock

A time function passed in as a dependency, a `std::function` that returns the time as text. Tests pass a fixed clock, and `main` passes the real `now_iso`.

Where the book teaches it

Related terms

Dependency injectionStubISO 8601