Fixup template type argument inference for vector matchers

This commit is contained in:
Martin Hořeňovský
2020-04-21 19:09:45 +02:00
parent cfb6956698
commit f4fc2dab2c
7 changed files with 75 additions and 16 deletions

View File

@@ -151,7 +151,7 @@ namespace Matchers {
// The following functions create the actual matcher objects.
// This allows the types to be inferred
template<typename T, typename AllocComp, typename AllocMatch = AllocComp>
template<typename T, typename AllocComp = std::allocator<T>, typename AllocMatch = AllocComp>
Vector::ContainsMatcher<T, AllocComp, AllocMatch> Contains( std::vector<T, AllocComp> const& comparator ) {
return Vector::ContainsMatcher<T, AllocComp, AllocMatch>( comparator );
}
@@ -161,17 +161,17 @@ namespace Matchers {
return Vector::ContainsElementMatcher<T, Alloc>( comparator );
}
template<typename T, typename AllocComp, typename AllocMatch = AllocComp>
template<typename T, typename AllocComp = std::allocator<T>, typename AllocMatch = AllocComp>
Vector::EqualsMatcher<T, AllocComp, AllocMatch> Equals( std::vector<T, AllocComp> const& comparator ) {
return Vector::EqualsMatcher<T, AllocComp, AllocMatch>( comparator );
}
template<typename T, typename AllocComp, typename AllocMatch = AllocComp>
template<typename T, typename AllocComp = std::allocator<T>, typename AllocMatch = AllocComp>
Vector::ApproxMatcher<T, AllocComp, AllocMatch> Approx( std::vector<T, AllocComp> const& comparator ) {
return Vector::ApproxMatcher<T, AllocComp, AllocMatch>( comparator );
}
template<typename T, typename AllocComp, typename AllocMatch = AllocComp>
template<typename T, typename AllocComp = std::allocator<T>, typename AllocMatch = AllocComp>
Vector::UnorderedEqualsMatcher<T, AllocComp, AllocMatch> UnorderedEquals(std::vector<T, AllocComp> const& target) {
return Vector::UnorderedEqualsMatcher<T, AllocComp, AllocMatch>( target );
}