id,summary,reporter,owner,description,type,status,milestone,component,version,severity,resolution,keywords,cc 4337,info.hpp: unnecessary (?) temporary shared_ptr,niels_dekker,Emil Dotchevski,"It seems to me that the creation of a temporary shared_ptr object at [https://svn.boost.org/trac/boost/browser/trunk/boost/exception/info.hpp?rev=61602#L117 info.hpp line 117] is unnecessary: {{{ shared_ptr const & x = i->second; }}} In the quoted code above, a temporary copy of i->second must be created, because i->second itself is a non-const shared_ptr. It seems to me that this temporary copy can be avoided easily by removing the inner const from the type of x: {{{ shared_ptr const & x = i->second; }}} Or by declaring x as a raw pointer: {{{ error_info_base const * const x = i->second.get(); }}} What do you think? FYI, this line of code drew my attention, because of a Codegear warning: {{{ Warning W8028 ..\..\..\boost/exception/info.hpp 117: Temporary used to initialize 'x' in function error_info_container_impl::diagnostic_information(const char *) const }}} Each of the two suggested changes would fix the warning.",Bugs,closed,Boost 1.43.0,exception,Boost 1.44.0,Optimization,fixed,,