In this example all but the three named blocks are erased from the SLHAea::Coll with the help of the unary function object SLHAea::Coll::key_matches:
#include <fstream>
#include <iostream>
using namespace std;
using namespace SLHAea;
int main()
{
ifstream ifs("slha2.txt");
cout <<
"Size before erasing blocks: " << input.
size() << endl;
is_rvkappa("RVKAPPA"),
is_rvsnvev("RVSNVEV"),
is_sphenorp("SPhenoRP");
{
if (is_rvkappa(*block) || is_rvsnvev(*block) || is_sphenorp(*block))
{ ++block; }
else block = input.
erase(block);
}
cout <<
"Size after erasing blocks: " << input.
size() << endl;
}