mirror of
https://github.com/google/googletest.git
synced 2026-06-15 08:26:11 +08:00
Compare commits
2 Commits
dc423ae29a
...
6204e246a4
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6204e246a4 | ||
|
|
f1e068d5c5 |
@ -99,6 +99,7 @@ class [[nodiscard]] ParamGenerator;
|
||||
template <typename T>
|
||||
class [[nodiscard]] ParamIteratorInterface {
|
||||
public:
|
||||
ParamIteratorInterface() = default;
|
||||
virtual ~ParamIteratorInterface() = default;
|
||||
// A pointer to the base generator instance.
|
||||
// Used only for the purposes of iterator comparison
|
||||
@ -121,6 +122,9 @@ class [[nodiscard]] ParamIteratorInterface {
|
||||
// element in the sequence generated by the generator.
|
||||
// Used for implementing ParamGenerator<T>::operator==().
|
||||
virtual bool Equals(const ParamIteratorInterface& other) const = 0;
|
||||
protected:
|
||||
// Make available for subclasses to use to implement Clone().
|
||||
ParamIteratorInterface(const ParamIteratorInterface&) = default;
|
||||
};
|
||||
|
||||
// Class iterating over elements provided by an implementation of
|
||||
@ -844,7 +848,7 @@ class [[nodiscard]] CartesianProductGenerator
|
||||
template <class I>
|
||||
class IteratorImpl;
|
||||
template <size_t... I>
|
||||
class IteratorImpl<std::index_sequence<I...>>
|
||||
class IteratorImpl<std::index_sequence<I...>> final
|
||||
: public ParamIteratorInterface<ParamType> {
|
||||
public:
|
||||
IteratorImpl(const ParamGeneratorInterface<ParamType>* base,
|
||||
@ -856,7 +860,7 @@ class [[nodiscard]] CartesianProductGenerator
|
||||
current_(is_end ? end_ : begin_) {
|
||||
ComputeCurrentValue();
|
||||
}
|
||||
~IteratorImpl() override = default;
|
||||
~IteratorImpl() final = default;
|
||||
|
||||
const ParamGeneratorInterface<ParamType>* BaseGenerator() const override {
|
||||
return base_;
|
||||
@ -900,6 +904,8 @@ class [[nodiscard]] CartesianProductGenerator
|
||||
}
|
||||
|
||||
private:
|
||||
IteratorImpl(const IteratorImpl&) = default;
|
||||
|
||||
template <size_t ThisI>
|
||||
void AdvanceIfEnd() {
|
||||
if (std::get<ThisI>(current_) != std::get<ThisI>(end_)) return;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user