167 6 C:\Users\reshm\OneDrive\Documents\assign2\IntS... C:\Users\reshm\OneDrive\Documents\assign2\IntS... C:\Users\reshm\OneDrive\Documents\assign2\IntS... 122 11 108 7 8 [Error] no declaration matches void IntSet:intersect(const IntSet&)' [Note] candidate is: "IntSet IntSet intersect(const IntSet&) const [Note] 'class IntSet' defined here
#ifndef INT_SET_H
#define INT_SET_H
#include <iostream>
class IntSet
{
public:
static const int DEFAULT_CAPACITY = 1;
IntSet(int initial_capacity = DEFAULT_CAPACITY);
IntSet(const IntSet& src);
~IntSet();
IntSet& operator=(const IntSet& rhs);
int size() const;
bool isEmpty() const;
bool contains(int anInt) const;
bool isSubsetOf(const IntSet& otherIntSet) const;
void DumpData(std::ostream& out) const;
IntSet unionWith(const IntSet& otherIntSet) const;
IntSet intersect(const IntSet& otherIntSet) const;
IntSet subtract(const IntSet& otherIntSet) const;
void reset();
bool add(int anInt);
bool remove(int anInt);
private:
int* data;
int capacity;
int used;
void resize(int new_capacity);
};
bool operator==(const IntSet& is1, const IntSet& is2);
#endif
Step by step
Solved in 2 steps