Array<TcpSocket> a; TcpSocket *s = new TcpSocket; s->... if(...) a.Add(s); else delete s;
One<TcpSocket> s; s.Create(); s->... if(...) a.Add(s.Detach()); // avoids need to delete (which you can forget to do ;)
TcpSocket& s = a.Add(); ... if(!...) a.Drop();
Report message to a moderator