mirror of
https://github.com/mat007/turtle.git
synced 2026-06-22 12:13:43 +00:00
Cleanup
git-svn-id: https://svn.code.sf.net/p/turtle/code/trunk@661 860be788-9bd5-4423-9f1e-828f051e677b
This commit is contained in:
parent
400aaddf9a
commit
0577e506c6
1 changed files with 28 additions and 28 deletions
|
|
@ -33,50 +33,50 @@ namespace mock
|
||||||
|
|
||||||
namespace detail
|
namespace detail
|
||||||
{
|
{
|
||||||
template< typename Constraint1, typename Constraint2 >
|
template< typename Lhs, typename Rhs >
|
||||||
class and_
|
class and_
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
and_( const Constraint1& c1, const Constraint2& c2 )
|
and_( const Lhs& lhs, const Rhs& rhs )
|
||||||
: c1_( c1 )
|
: lhs_( lhs )
|
||||||
, c2_( c2 )
|
, rhs_( rhs )
|
||||||
{}
|
{}
|
||||||
template< typename Actual >
|
template< typename Actual >
|
||||||
bool operator()( const Actual& actual ) const
|
bool operator()( const Actual& actual ) const
|
||||||
{
|
{
|
||||||
return c1_( actual ) && c2_( actual );
|
return lhs_( actual ) && rhs_( actual );
|
||||||
}
|
}
|
||||||
friend std::ostream& operator<<( std::ostream& s, const and_& a )
|
friend std::ostream& operator<<( std::ostream& s, const and_& a )
|
||||||
{
|
{
|
||||||
return s << "( " << mock::format( a.c1_ )
|
return s << "( " << mock::format( a.lhs_ )
|
||||||
<< " && " << mock::format( a.c2_ ) << " )";
|
<< " && " << mock::format( a.rhs_ ) << " )";
|
||||||
}
|
}
|
||||||
private:
|
private:
|
||||||
Constraint1 c1_;
|
Lhs lhs_;
|
||||||
Constraint2 c2_;
|
Rhs rhs_;
|
||||||
};
|
};
|
||||||
|
|
||||||
template< typename Constraint1, typename Constraint2 >
|
template< typename Lhs, typename Rhs >
|
||||||
class or_
|
class or_
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
or_( const Constraint1& c1, const Constraint2& c2 )
|
or_( const Lhs& lhs, const Rhs& rhs )
|
||||||
: c1_( c1 )
|
: lhs_( lhs )
|
||||||
, c2_( c2 )
|
, rhs_( rhs )
|
||||||
{}
|
{}
|
||||||
template< typename Actual >
|
template< typename Actual >
|
||||||
bool operator()( const Actual& actual ) const
|
bool operator()( const Actual& actual ) const
|
||||||
{
|
{
|
||||||
return c1_( actual ) || c2_( actual );
|
return lhs_( actual ) || rhs_( actual );
|
||||||
}
|
}
|
||||||
friend std::ostream& operator<<( std::ostream& s, const or_& o )
|
friend std::ostream& operator<<( std::ostream& s, const or_& o )
|
||||||
{
|
{
|
||||||
return s << "( " << mock::format( o.c1_ )
|
return s << "( " << mock::format( o.lhs_ )
|
||||||
<< " || " << mock::format( o.c2_ )<< " )";
|
<< " || " << mock::format( o.rhs_ )<< " )";
|
||||||
}
|
}
|
||||||
private:
|
private:
|
||||||
Constraint1 c1_;
|
Lhs lhs_;
|
||||||
Constraint2 c2_;
|
Rhs rhs_;
|
||||||
};
|
};
|
||||||
|
|
||||||
template< typename Constraint >
|
template< typename Constraint >
|
||||||
|
|
@ -100,20 +100,20 @@ namespace detail
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
template< typename Constraint1, typename Constraint2 >
|
template< typename Lhs, typename Rhs >
|
||||||
const constraint< detail::or_< Constraint1, Constraint2 > >
|
const constraint< detail::or_< Lhs, Rhs > >
|
||||||
operator||( const constraint< Constraint1 >& lhs,
|
operator||( const constraint< Lhs >& lhs,
|
||||||
const constraint< Constraint2 >& rhs )
|
const constraint< Rhs >& rhs )
|
||||||
{
|
{
|
||||||
return detail::or_< Constraint1, Constraint2 >( lhs.c_, rhs.c_ );
|
return detail::or_< Lhs, Rhs >( lhs.c_, rhs.c_ );
|
||||||
}
|
}
|
||||||
|
|
||||||
template< typename Constraint1, typename Constraint2 >
|
template< typename Lhs, typename Rhs >
|
||||||
const constraint< detail::and_< Constraint1, Constraint2 > >
|
const constraint< detail::and_< Lhs, Rhs > >
|
||||||
operator&&( const constraint< Constraint1 >& lhs,
|
operator&&( const constraint< Lhs >& lhs,
|
||||||
const constraint< Constraint2 >& rhs )
|
const constraint< Rhs >& rhs )
|
||||||
{
|
{
|
||||||
return detail::and_< Constraint1, Constraint2 >( lhs.c_, rhs.c_ );
|
return detail::and_< Lhs, Rhs >( lhs.c_, rhs.c_ );
|
||||||
}
|
}
|
||||||
|
|
||||||
template< typename Constraint >
|
template< typename Constraint >
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue