class Zsak { public: Zsak(); ~Zsak(); void Add( int x ); friend ostream& operator<< (std::ostream& os, Zsak& zs); friend Zsak operator+( const Zsak &a, const Zsak &b ); private: list zs; }; std::ostream& operator<< (std::ostream& os, Zsak& zs) { list::iterator i; for( i = zs.zs.begin(); i != zs.zs.end(); i++ ) os << *i << " "; return os; } Zsak operator+( const Zsak &a, const Zsak &b ) { Zsak ret; list::iterator i; for( i = a.zs.begin(); i != a.zs.end(); i++ ) ret.Add( *i ); }