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

summaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorPhil Nash2017-08-17 16:46:05 +0100
committerPhil Nash2017-08-17 16:46:05 +0100
commitaaedae60b41121da6c2d0e362f8a6bba2b420e00 (patch)
tree55064d4c32e820389ab99d369e64818ecca1dad3 /include
parentff9aaf3afebe0281fbae28a16e444ac95756b6e6 (diff)
downloadcatch3-aaedae60b41121da6c2d0e362f8a6bba2b420e00.tar.gz
Fixed issue with comparing non-copyable values
Diffstat (limited to 'include')
-rw-r--r--include/internal/catch_decomposer.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/internal/catch_decomposer.h b/include/internal/catch_decomposer.h
index 6d20be78..8cb4c1d4 100644
--- a/include/internal/catch_decomposer.h
+++ b/include/internal/catch_decomposer.h
@@ -76,14 +76,14 @@ namespace Catch {
// Specialised comparison functions to handle equality comparisons between ints and pointers (NULL deduces as an int)
template<typename LhsT, typename RhsT>
- auto compareEqual( LhsT lhs, RhsT&& rhs ) -> bool { return lhs == rhs; };
+ auto compareEqual( LhsT const& lhs, RhsT&& rhs ) -> bool { return const_cast<LhsT&>( lhs ) == rhs; };
template<typename T>
auto compareEqual( T* const& lhs, int rhs ) -> bool { return lhs == reinterpret_cast<void const*>( rhs ); };
template<typename T>
auto compareEqual( int lhs, T* const& rhs ) -> bool { return reinterpret_cast<void const*>( lhs ) == rhs; };
template<typename LhsT, typename RhsT>
- auto compareNotEqual( LhsT lhs, RhsT&& rhs ) -> bool { return lhs != rhs; };
+ auto compareNotEqual( LhsT const& lhs, RhsT&& rhs ) -> bool { return const_cast<LhsT&>( lhs ) != rhs; };
template<typename T>
auto compareNotEqual( T* const& lhs, int rhs ) -> bool { return lhs != reinterpret_cast<void const*>( rhs ); };
template<typename T>