Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorPhil Nash2012-05-07 19:45:55 +0100
committerPhil Nash2012-05-07 19:45:55 +0100
commite1cb8f25f2c1da70f1a99ec842e20d83ea4340ff (patch)
tree8abd9bc0cefb670195a9fbc509617795b9ef9095 /include
parenta201f715a84c3f936e2442e40b4c7f3072d41326 (diff)
downloadcatch3-e1cb8f25f2c1da70f1a99ec842e20d83ea4340ff.tar.gz
Fix for comparing (const) char* to NULL
Diffstat (limited to 'include')
-rw-r--r--include/internal/catch_evaluate.hpp16
1 files changed, 13 insertions, 3 deletions
diff --git a/include/internal/catch_evaluate.hpp b/include/internal/catch_evaluate.hpp
index 90acad26..38e14f1a 100644
--- a/include/internal/catch_evaluate.hpp
+++ b/include/internal/catch_evaluate.hpp
@@ -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