diff --git a/README.md b/README.md index 3725a398..78245ac6 100644 --- a/README.md +++ b/README.md @@ -64,6 +64,8 @@ public: class StdoutWriter : public Writer { public: + // Like "StdoutWriter() = default;" but also marks this constructor as the + // one to use for injection. INJECT(StdoutWriter()) = default; virtual ~StdoutWriter() = default; @@ -83,6 +85,8 @@ private: Writer* writer; public: + // Like "GreeterImpl(Writer* writer) {...}" but also marks this constructor + // as the one to use for injection. INJECT(GreeterImpl(Writer* writer)) : writer(writer) { } @@ -110,6 +114,8 @@ int main() { } ``` +More documentation is coming soon, stay tuned. + ### Example code For examples on how code looks like when using Fruit, look at the examples/ directory in the source tree. diff --git a/examples/hello_world/main.cpp b/examples/hello_world/main.cpp index 59518612..eec70381 100644 --- a/examples/hello_world/main.cpp +++ b/examples/hello_world/main.cpp @@ -12,6 +12,8 @@ class Writer { class StdoutWriter : public Writer { public: + // Like "StdoutWriter() = default;" but also marks this constructor as the + // one to use for injection. INJECT(StdoutWriter()) = default; virtual ~StdoutWriter() = default; @@ -31,6 +33,8 @@ class GreeterImpl : public Greeter { Writer* writer; public: + // Like "GreeterImpl(Writer* writer) {...}" but also marks this constructor + // as the one to use for injection. INJECT(GreeterImpl(Writer* writer)) : writer(writer) { }