Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
path: root/docs
diff options
context:
space:
mode:
authorMartin Hořeňovský2025-10-06 11:47:38 +0200
committerMartin Hořeňovský2026-01-12 16:58:15 +0100
commit9eca713a1f4555b3095564781d77654958ee3dc1 (patch)
treee500e9b38c705f7f08ca412af16cb843cb80088e /docs
parent44c597f0742b491399994afa00070b99d3ef2885 (diff)
downloadcatch3-9eca713a1f4555b3095564781d77654958ee3dc1.tar.gz
Add option to skip forward to the generator interface
Diffstat (limited to 'docs')
-rw-r--r--docs/generators.md14
1 files changed, 14 insertions, 0 deletions
diff --git a/docs/generators.md b/docs/generators.md
index b01ec906..f45eac06 100644
--- a/docs/generators.md
+++ b/docs/generators.md
@@ -264,9 +264,23 @@ struct IGenerator : GeneratorUntypedBase {
// Returns user-friendly string showing the current generator element
// Does not have to be overridden, IGenerator provides default implementation
virtual std::string stringifyImpl() const;
+
+ /**
+ * Customization point for `skipToNthElement`
+ *
+ * Does not have to be overridden, there is a default implementation.
+ * Can be overridden for better performance.
+ *
+ * If there are not enough elements, shall throw an error.
+ *
+ * Going backwards is not supported.
+ */
+ virtual void skipToNthElementImpl( std::size_t n );
};
```
+> `skipToNthElementImpl` was added in Catch2 vX.Y.Z
+
However, to be able to use your custom generator inside `GENERATE`, it
will need to be wrapped inside a `GeneratorWrapper<T>`.
`GeneratorWrapper<T>` is a value wrapper around a