mirror of
https://github.com/catchorg/Catch2.git
synced 2025-10-09 12:15:39 +02:00
Add option to skip forward to the generator interface
This commit is contained in:
@@ -252,9 +252,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
|
||||
|
Reference in New Issue
Block a user