Skip to content

Instantly share code, notes, and snippets.

@bwiklak
bwiklak / rle.cpp
Created April 6, 2012 21:19
RLE encoding in C++
template< typename C >
string rle( const C& input )
{
stringstream out;
typedef C::const_iterator::value_type el_tyle;
pair<C::const_iterator,C::const_iterator> bounds;
bounds.second=input.begin();
while( (bounds.first=bounds.second)!=input.end() )
{