环境配置
codeblocks
windows10
项目结构
代码
SetClass.h
#ifndef _SETCLASS_H_
#define _SETCLASS_H_
#include <iostream>
template <typename T>
class SetClass
{
public:
const static int MAXSIZE;
SetClass(void);
SetClass(const T *a, int n);
~SetClass(void);
bool IsInSet(const T &e) const;
bool Insert(const T &e);
bool Delete(const T &e);
void Display(void) const;
SetClass<T> &Union(const SetClass<T> &S) const;
SetClass<T> &Intersection(const SetClass<T> &S) const;
SetClass<T> &Difference(const SetClass<T> &S) const;
private:
int *data;
int n;
};
template <typename T>
const int SetClass<T>::MAXSIZE = 100;
template <typename T>
SetClass<T>