Refactoring to pass boost::optional by value instead of const ref

git-svn-id: https://svn.code.sf.net/p/turtle/code/trunk@485 860be788-9bd5-4423-9f1e-828f051e677b
This commit is contained in:
mat007 2012-07-22 07:02:21 +00:00
parent e56c9f586e
commit 0357fe1dda
7 changed files with 10 additions and 11 deletions

View file

@ -27,7 +27,7 @@ namespace detail
{}
void update( parent& p,
boost::unit_test::const_string instance,
const boost::optional< type_name >& type,
boost::optional< type_name > type,
boost::unit_test::const_string name )
{
if( instance != "?." || name_.empty() )

View file

@ -29,7 +29,7 @@ namespace detail
virtual void add( const void* p, verifiable& v,
boost::unit_test::const_string instance,
const boost::optional< type_name >& type,
boost::optional< type_name > type,
boost::unit_test::const_string name ) = 0;
virtual void add( verifiable& v ) = 0;
virtual void remove( verifiable& v ) = 0;

View file

@ -92,7 +92,7 @@ namespace mock
void configure( detail::context& c, const void* p,
boost::unit_test::const_string instance,
const boost::optional< detail::type_name >& type,
boost::optional< detail::type_name > type,
boost::unit_test::const_string name ) const
{
if( ! impl_->context_ )

View file

@ -29,7 +29,7 @@ namespace detail
public:
virtual void add( const void* /*p*/, detail::verifiable& v,
boost::unit_test::const_string instance,
const boost::optional< detail::type_name >& type,
boost::optional< detail::type_name > type,
boost::unit_test::const_string name )
{
if( children_.empty() )

View file

@ -24,7 +24,7 @@ namespace detail
parent()
{}
parent( boost::unit_test::const_string instance,
const boost::optional< type_name >& type )
boost::optional< type_name > type )
: instance_( instance )
, type_( type )
{}

View file

@ -27,7 +27,7 @@ namespace detail
public:
virtual void add( const void* p, verifiable& v,
boost::unit_test::const_string instance,
const boost::optional< type_name >& type,
boost::optional< type_name > type,
boost::unit_test::const_string name )
{
children_it it = children_.lower_bound( &v );
@ -94,7 +94,7 @@ namespace detail
parents_->erase( it_ );
}
void update( boost::unit_test::const_string instance,
const boost::optional< type_name >& type,
boost::optional< type_name > type,
boost::unit_test::const_string name )
{
child_.update( it_->second.first, instance, type, name );

View file

@ -38,17 +38,17 @@ namespace detail
template< typename E >
E& configure( const object& o, E& e,
boost::unit_test::const_string instance,
const boost::optional< type_name >& type,
boost::optional< detail::type_name > type,
boost::unit_test::const_string name )
{
e.configure( *o.impl_, o.impl_.get(), instance, type, name );
return e;
}
template< typename E, typename T >
template< typename T, typename E >
E& configure( const T& t, E& e,
boost::unit_test::const_string instance,
const boost::optional< type_name >& type,
boost::optional< detail::type_name > type,
boost::unit_test::const_string name,
BOOST_DEDUCED_TYPENAME boost::disable_if<
BOOST_DEDUCED_TYPENAME boost::is_base_of< object, T >
@ -58,7 +58,6 @@ namespace detail
return e;
}
}
inline bool verify( const object& o )
{
return o.impl_->verify();