Boost logo

Boost :

From: Robert Dailey (rcdailey_at_[hidden])
Date: 2008-03-19 19:40:42


On Wed, Mar 19, 2008 at 5:37 PM, Scott McMurray <me22.ca+boost_at_[hidden]>
wrote:

> On Wed, Mar 19, 2008 at 6:31 PM, Robert Dailey <rcdailey_at_[hidden]> wrote:
> > Below I have posted code that I'm trying to clean up. I'm specifically
> > trying to clean up the MainFunction() implementation.
> > [...]
> >
>
> Sounds like auto_ptr could be of help:
>
> void MainFunction()
> {
> std::auto_ptr<Socket> mySocket(new Socket);
>
> if( mySocket->Connect() )
> {
> sockets.push_back( mySocket.release() );
> }
> }
>
> HTH,
> ~ Scott
>
> P.S. I think this kind of issue is more suited for boost-users than
> boost-dev, for future posts.

Thanks, sometimes boost makes me overlook STL :) This is what I needed.

I'll be sure to post on boost-user next time. The names are somewhat
identical in my address book so sometimes I post to the wrong one.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk