diff options
| author | Martin Hořeňovský | 2021-05-19 11:00:53 +0200 |
|---|---|---|
| committer | Martin Hořeňovský | 2021-05-19 11:00:53 +0200 |
| commit | 023b5306b444ebe3c20a008cdd150cf5510ff36d (patch) | |
| tree | f309c0846f78aed4495b9f2d56145f2cceffd30d /src/catch2/internal | |
| parent | 9137e591fa7d7fee2e8c1d3bfeb55068deb2c665 (diff) | |
| download | catch3-023b5306b444ebe3c20a008cdd150cf5510ff36d.tar.gz | |
Add deep const to unique_ptr::operator->
Diffstat (limited to 'src/catch2/internal')
| -rw-r--r-- | src/catch2/internal/catch_unique_ptr.hpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/catch2/internal/catch_unique_ptr.hpp b/src/catch2/internal/catch_unique_ptr.hpp index 758b22da..d3bc8417 100644 --- a/src/catch2/internal/catch_unique_ptr.hpp +++ b/src/catch2/internal/catch_unique_ptr.hpp @@ -64,7 +64,11 @@ namespace Detail { assert(m_ptr); return *m_ptr; } - T* operator->() const noexcept { + T* operator->() noexcept { + assert(m_ptr); + return m_ptr; + } + T const* operator->() const noexcept { assert(m_ptr); return m_ptr; } |