Actually your write_event looks like it would best suited as a function-object. Then you could call
Code:
std::for_each( v.begin(), v.end(), MyEventWriter( my_outstream ) );
Alternatively if you want to create MyEventWriter so you still have a copy of it after the std::for_each you can create it first, thus:

Code:
MyEventWriter evwr( myOutStream );
std::for_each( v.begin(), v.end(), evwr );
If you don't want to use operator() in evwr but a named member function instead, you can use bind.