Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions googletest/include/gtest/internal/gtest-param-util.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ class ParamGenerator;
template <typename T>
class ParamIteratorInterface {
public:
ParamIteratorInterface() = default;
virtual ~ParamIteratorInterface() = default;
// A pointer to the base generator instance.
// Used only for the purposes of iterator comparison
Expand All @@ -121,6 +122,9 @@ class 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
Expand Down Expand Up @@ -842,7 +846,7 @@ class 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,
Expand All @@ -854,7 +858,7 @@ class CartesianProductGenerator
current_(is_end ? end_ : begin_) {
ComputeCurrentValue();
}
~IteratorImpl() override = default;
~IteratorImpl() final = default;

const ParamGeneratorInterface<ParamType>* BaseGenerator() const override {
return base_;
Expand Down Expand Up @@ -898,6 +902,8 @@ class CartesianProductGenerator
}

private:
IteratorImpl(const IteratorImpl&) = default;

template <size_t ThisI>
void AdvanceIfEnd() {
if (std::get<ThisI>(current_) != std::get<ThisI>(end_)) return;
Expand Down