mirror of
https://github.com/catchorg/Catch2.git
synced 2024-11-22 21:36:11 +01:00
Update generator docs
This commit is contained in:
parent
b5be642042
commit
3486f8ed9e
@ -205,13 +205,17 @@ struct IGenerator : GeneratorUntypedBase {
|
|||||||
// Precondition:
|
// Precondition:
|
||||||
// The generator is either freshly constructed or the last call to next() returned true
|
// The generator is either freshly constructed or the last call to next() returned true
|
||||||
virtual T const& get() const = 0;
|
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
|
However, to be able to use your custom generator inside `GENERATE`, it
|
||||||
will need to be wrapped inside a `GeneratorWrapper<T>`.
|
will need to be wrapped inside a `GeneratorWrapper<T>`.
|
||||||
`GeneratorWrapper<T>` is a value wrapper around a
|
`GeneratorWrapper<T>` is a value wrapper around a
|
||||||
`std::unique_ptr<IGenerator<T>>`.
|
`Catch::Detail::unique_ptr<IGenerator<T>>`.
|
||||||
|
|
||||||
For full example of implementing your own generator, look into Catch2's
|
For full example of implementing your own generator, look into Catch2's
|
||||||
examples, specifically
|
examples, specifically
|
||||||
|
Loading…
Reference in New Issue
Block a user