mirror of
https://github.com/mat007/turtle.git
synced 2026-06-22 12:13:43 +00:00
Fixed regression
git-svn-id: https://svn.code.sf.net/p/turtle/code/trunk@665 860be788-9bd5-4423-9f1e-828f051e677b
This commit is contained in:
parent
24530c4e3c
commit
c697b48802
7 changed files with 76 additions and 24 deletions
|
|
@ -12,9 +12,7 @@
|
|||
#include "../config.hpp"
|
||||
#include "lambda.hpp"
|
||||
#include <boost/type_traits/remove_reference.hpp>
|
||||
#include <boost/type_traits/is_convertible.hpp>
|
||||
#include <boost/type_traits/remove_const.hpp>
|
||||
#include <boost/utility/enable_if.hpp>
|
||||
#include <boost/make_shared.hpp>
|
||||
#include <boost/function.hpp>
|
||||
#include <boost/ref.hpp>
|
||||
|
|
@ -37,26 +35,19 @@ namespace detail
|
|||
|
||||
public:
|
||||
template< typename Value >
|
||||
void returns( Value v,
|
||||
BOOST_DEDUCED_TYPENAME boost::enable_if<
|
||||
boost::is_convertible< Value, result_type > >::type* = 0 )
|
||||
void returns( Value v )
|
||||
{
|
||||
r_ = boost::make_shared< Value >( v );
|
||||
f_ = lambda_type::make_val( boost::ref( *r_ ) );
|
||||
}
|
||||
template< typename Value >
|
||||
void returns( Value* v )
|
||||
{
|
||||
r_ = boost::make_shared< result_type >( v );
|
||||
f_ = lambda_type::make_val( boost::ref( *r_ ) );
|
||||
}
|
||||
template< typename Value >
|
||||
void returns( Value v,
|
||||
BOOST_DEDUCED_TYPENAME boost::disable_if<
|
||||
boost::is_convertible< Value, result_type > >::type* = 0 )
|
||||
{
|
||||
// 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_ = boost::make_shared< Value >( v );
|
||||
f_ = lambda_type::make_val( boost::ref( *r_ ) );
|
||||
}
|
||||
template< typename Y >
|
||||
void returns( boost::reference_wrapper< Y > r )
|
||||
void returns( const boost::reference_wrapper< Y >& r )
|
||||
{
|
||||
f_ = lambda_type::make_val( r );
|
||||
}
|
||||
|
|
@ -98,7 +89,7 @@ namespace detail
|
|||
f_ = lambda_type::make_val( r );
|
||||
}
|
||||
template< typename Y >
|
||||
void returns( boost::reference_wrapper< Y > r )
|
||||
void returns( const boost::reference_wrapper< Y >& r )
|
||||
{
|
||||
f_ = lambda_type::make_val( r );
|
||||
}
|
||||
|
|
@ -211,7 +202,7 @@ namespace detail
|
|||
f_ = lambda_type::make_val( boost::ref( r_ ) );
|
||||
}
|
||||
template< typename Y >
|
||||
void set( boost::reference_wrapper< Y > r )
|
||||
void set( const boost::reference_wrapper< Y >& r )
|
||||
{
|
||||
f_ = lambda_type::make_val( r );
|
||||
r_.reset();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue