ネタ元 → GenericList(of Class) から一定条件の要素を取り除く
C++版。
#include <iostream>
#include <utility>
#include <vector>
#include <string>
#include <algorithm>
using namespace std;
int main() {
typedef pair<string,string> Cat;
vector<Cat> Nyans;
Nyans.push_back(Cat("しゅうたん", "アメショ"));
Nyans.push_back(Cat("ろり", "アメショ"));
Nyans.push_back(Cat("みずきちゃん", "スコティ"));
Nyans.push_back(Cat("マグさん", "ほげ"));
Nyans.erase(remove_if(Nyans.begin(),Nyans.end(),
[](Cat x){return x.second=="ほげ";}),
Nyans.end());
for_each(Nyans.begin(),Nyans.end(),
[](Cat x){cout << x.first << "は" << x.second << endl;});
}
おんなじことやってんだけどもVBとは雰囲気がぜーんぜんちゃいますな。