Replaced new with boost::make_shared

git-svn-id: https://svn.code.sf.net/p/turtle/code/trunk@634 860be788-9bd5-4423-9f1e-828f051e677b
This commit is contained in:
mat007 2013-05-03 20:16:50 +00:00
parent 26540da771
commit 4ee2837dcd
7 changed files with 23 additions and 25 deletions

View file

@ -15,7 +15,7 @@
#include <boost/type_traits/is_convertible.hpp>
#include <boost/type_traits/remove_const.hpp>
#include <boost/utility/enable_if.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/make_shared.hpp>
#include <boost/function.hpp>
#include <boost/ref.hpp>
@ -41,7 +41,7 @@ namespace detail
BOOST_DEDUCED_TYPENAME boost::enable_if<
boost::is_convertible< Value, result_type > >::type* = 0 )
{
r_.reset( new result_type( v ) );
r_ = boost::make_shared< result_type >( v );
f_ = lambda_type::make_val( boost::ref( *r_ ) );
}
template< typename Value >
@ -52,7 +52,7 @@ namespace detail
// if an error is generated by the line below it means a value
// passed to 'returns' was of the wrong type as it cannot be
// used to copy construct a Result
r_.reset( new Value( v ) );
r_ = boost::make_shared< Value >( v );
f_ = lambda_type::make_val( boost::ref( *r_ ) );
}
template< typename Y >