Hi,
I've been following this thread and been unable to do the same with:
boost::shared_ptr< map
, std::string)a
Thanks a lot in advance. -----Mensaje original----- De: boost-users-bounces@lists.boost.org [mailto:boost-users-bounces@lists.boost.org]En nombre de Scott Amort Enviado el: lunes, 14 de agosto de 2006 1:09 Para: boost-users@lists.boost.org Asunto: Re: [Boost-users] assign shared_ptr to 0 in initialization list Hi Scott, Thanks for the quick reply! On Sun, 2006-08-13 at 18:11 -0400, me22 wrote:
Instead of
if (writer_.get() == 0) { /* create default error writer */ } Why not just use if ( !writer_ ) { /* create default error writer */ } instead? This would work with ordinary pointers too.
Thanks, that is clearer!
What is the equivalent to:
Parser testParser(0);
Parser testParser( ErrorWriterPtr() ); // would work
I'd be tempted instead to replace the constructor definition with Parser(ErrorWriterPtr writer = ErrorWritePtr()) : writer_(writer) { } however, to be able to just say Parser testParser; if you don't want to specify the writer.
Perfect! Thanks again. Best, Scott _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users