mirror of
				https://github.com/catchorg/Catch2.git
				synced 2025-11-03 21:49:32 +01:00 
			
		
		
		
	ApproxMacher uses Approx's overloads for double directly
This saves a tiny little bit of compilation times when the `ApproxMatcher` is used and `epsilon`, `margin`, or `scale` are used to customize its behaviour.
This commit is contained in:
		@@ -116,17 +116,17 @@ namespace Matchers {
 | 
				
			|||||||
        }
 | 
					        }
 | 
				
			||||||
        template <typename = std::enable_if_t<std::is_constructible<double, T>::value>>
 | 
					        template <typename = std::enable_if_t<std::is_constructible<double, T>::value>>
 | 
				
			||||||
        ApproxMatcher& epsilon( T const& newEpsilon ) {
 | 
					        ApproxMatcher& epsilon( T const& newEpsilon ) {
 | 
				
			||||||
            approx.epsilon(newEpsilon);
 | 
					            approx.epsilon(static_cast<double>(newEpsilon));
 | 
				
			||||||
            return *this;
 | 
					            return *this;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        template <typename = std::enable_if_t<std::is_constructible<double, T>::value>>
 | 
					        template <typename = std::enable_if_t<std::is_constructible<double, T>::value>>
 | 
				
			||||||
        ApproxMatcher& margin( T const& newMargin ) {
 | 
					        ApproxMatcher& margin( T const& newMargin ) {
 | 
				
			||||||
            approx.margin(newMargin);
 | 
					            approx.margin(static_cast<double>(newMargin));
 | 
				
			||||||
            return *this;
 | 
					            return *this;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        template <typename = std::enable_if_t<std::is_constructible<double, T>::value>>
 | 
					        template <typename = std::enable_if_t<std::is_constructible<double, T>::value>>
 | 
				
			||||||
        ApproxMatcher& scale( T const& newScale ) {
 | 
					        ApproxMatcher& scale( T const& newScale ) {
 | 
				
			||||||
            approx.scale(newScale);
 | 
					            approx.scale(static_cast<double>(newScale));
 | 
				
			||||||
            return *this;
 | 
					            return *this;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user