mirror of
https://github.com/catchorg/Catch2.git
synced 2025-05-31 00:47:56 +00:00
Fix for comparing (const) char* to NULL
This commit is contained in:
parent
a201f715a8
commit
e1cb8f25f2
3 changed files with 20 additions and 4 deletions
|
@ -174,16 +174,26 @@ namespace Internal
|
|||
template<Operator Op, typename T>
|
||||
bool compare( long lhs, const T* rhs )
|
||||
{
|
||||
return Evaluator<T*, T*, Op>::evaluate( reinterpret_cast<T*>( NULL ), rhs );
|
||||
|
||||
return Evaluator<const T*, const T*, Op>::evaluate( reinterpret_cast<const T*>( lhs ), rhs );
|
||||
}
|
||||
|
||||
template<Operator Op, typename T>
|
||||
bool compare( long lhs, T* rhs )
|
||||
{
|
||||
return Evaluator<T*, T*, Op>::evaluate( reinterpret_cast<T*>( lhs ), rhs );
|
||||
|
||||
}
|
||||
|
||||
template<Operator Op, typename T>
|
||||
bool compare( const T* lhs, long rhs )
|
||||
{
|
||||
return Evaluator<const T*, const T*, Op>::evaluate( lhs, reinterpret_cast<const T*>( rhs ) );
|
||||
}
|
||||
|
||||
template<Operator Op, typename T>
|
||||
bool compare( T* lhs, long rhs )
|
||||
{
|
||||
return Evaluator<T*, T*, Op>::evaluate( lhs, reinterpret_cast<T*>( rhs ) );
|
||||
}
|
||||
|
||||
} // end of namespace Internal
|
||||
} // end of namespace Catch
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue