Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- using namespace std;
- using predicate = bool(*)(int);
- class IntReader
- {
- public:
- virtual bool read()=0;
- virtual int getData()=0;
- virtual bool isEmpty()=0;
- };
- class IntFilterReader : public IntReader
- {
- int n;
- bool isClean;
- public:
- IntFilterReader():isClean(false){}
- bool read()
- {
- int temp;
- cin>>temp;
- if(n!=0 && predicate(n))
- {
- isClean = true;
- n = temp;
- }
- }
- int getData()
- {
- }
- };
- int main()
- {
- cout<<"Successful compilation!"<<endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement