mirror of
https://github.com/catchorg/Catch2.git
synced 2024-11-26 15:26:11 +01:00
feature: double -> const auto when static_cast in right
</subject> Branch: devel <type>: - [ ] Bug fix - [ ] Bug fix (Test) - [x] New feature - [ ] Breaking change - [ ] Documentation update - [ ] This change requires a documentation update <body> <footer> Signed-off-by: Certseeds <51754303+Certseeds@users.noreply.github.com>
This commit is contained in:
parent
efb54926ee
commit
9afb6ce138
@ -86,14 +86,14 @@ namespace Catch {
|
|||||||
|
|
||||||
template <typename T, typename = std::enable_if_t<std::is_constructible<double, T>::value>>
|
template <typename T, typename = std::enable_if_t<std::is_constructible<double, T>::value>>
|
||||||
Approx& epsilon( T const& newEpsilon ) {
|
Approx& epsilon( T const& newEpsilon ) {
|
||||||
double epsilonAsDouble = static_cast<double>(newEpsilon);
|
const auto epsilonAsDouble = static_cast<double>(newEpsilon);
|
||||||
setEpsilon(epsilonAsDouble);
|
setEpsilon(epsilonAsDouble);
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T, typename = std::enable_if_t<std::is_constructible<double, T>::value>>
|
template <typename T, typename = std::enable_if_t<std::is_constructible<double, T>::value>>
|
||||||
Approx& margin( T const& newMargin ) {
|
Approx& margin( T const& newMargin ) {
|
||||||
double marginAsDouble = static_cast<double>(newMargin);
|
const auto marginAsDouble = static_cast<double>(newMargin);
|
||||||
setMargin(marginAsDouble);
|
setMargin(marginAsDouble);
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user