From 3486f8ed9ed6a0832438bf29693626e10ad85bd4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Ho=C5=99e=C5=88ovsk=C3=BD?= Date: Wed, 18 Jan 2023 11:09:00 +0100 Subject: [PATCH] Update generator docs --- docs/generators.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/generators.md b/docs/generators.md index 7a865d43..69d1a02d 100644 --- a/docs/generators.md +++ b/docs/generators.md @@ -205,13 +205,17 @@ struct IGenerator : GeneratorUntypedBase { // Precondition: // The generator is either freshly constructed or the last call to next() returned true virtual T const& get() const = 0; + + // Returns user-friendly string showing the current generator element + // Does not have to be overridden, IGenerator provides default implementation + virtual std::string stringifyImpl() const; }; ``` However, to be able to use your custom generator inside `GENERATE`, it will need to be wrapped inside a `GeneratorWrapper`. `GeneratorWrapper` is a value wrapper around a -`std::unique_ptr>`. +`Catch::Detail::unique_ptr>`. For full example of implementing your own generator, look into Catch2's examples, specifically