diff options
| author | Certseeds | 2022-02-02 12:11:52 +0800 |
|---|---|---|
| committer | Martin Hořeňovský | 2022-02-04 00:09:01 +0100 |
| commit | 9afb6ce13898e2e11e62d06ccbcea1d81caab610 (patch) | |
| tree | 065d68cbf0faa4dcbacc0ff9082a921506a0decc | |
| parent | efb54926eec28900e020131930b35116075f6f84 (diff) | |
| download | catch3-9afb6ce13898e2e11e62d06ccbcea1d81caab610.tar.gz | |
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>
| -rw-r--r-- | src/catch2/catch_approx.hpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/catch2/catch_approx.hpp b/src/catch2/catch_approx.hpp index 7c3a17c0..a46caeb5 100644 --- a/src/catch2/catch_approx.hpp +++ b/src/catch2/catch_approx.hpp @@ -86,14 +86,14 @@ namespace Catch { template <typename T, typename = std::enable_if_t<std::is_constructible<double, T>::value>> Approx& epsilon( T const& newEpsilon ) { - double epsilonAsDouble = static_cast<double>(newEpsilon); + const auto epsilonAsDouble = static_cast<double>(newEpsilon); setEpsilon(epsilonAsDouble); return *this; } template <typename T, typename = std::enable_if_t<std::is_constructible<double, T>::value>> Approx& margin( T const& newMargin ) { - double marginAsDouble = static_cast<double>(newMargin); + const auto marginAsDouble = static_cast<double>(newMargin); setMargin(marginAsDouble); return *this; } |