#include
#include
#include
#include
#include
#include
using namespace std;
template
class is_vowel : public unary_function
public:
bool operator ()(T t) const
{
if ((t=='a')||(t=='e')||(t=='i')||(t=='o')||(t=='u'))
return true; //t is a vowel
return false; // t is not a vowel
}
};
bool greaterthan(int x) {
return x>6;
}
int main()
{
string original;
cout << "Type string to remove vowels." <<>> original;
//…
string::iterator it= remove_if(original.begin(),
original.end(),
is_vowel
// create new string from original using previous iterator
string no_vowels(original.begin(),it);
cout <
v1.push_back(7);
v1.push_back(1);
v1.push_back(9);
v1.push_back(2);
v1.push_back(0);
v1.push_back(7);
v1.push_back(7);
v1.push_back(3);
v1.push_back(4);
v1.push_back(6);
v1.push_back(8);
v1.push_back(5);
v1.push_back(7);
v1.push_back(7);
for(vector
cout<<" "<< *itr_prn ; cout <
vector
for(;itrb != itre; itrb++)
cout << " " << *itrb;
}
No comments:
Post a Comment