Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
path: root/src/catch2/internal
diff options
context:
space:
mode:
authorMartin Hořeňovský2021-05-19 11:00:53 +0200
committerMartin Hořeňovský2021-05-19 11:00:53 +0200
commit023b5306b444ebe3c20a008cdd150cf5510ff36d (patch)
treef309c0846f78aed4495b9f2d56145f2cceffd30d /src/catch2/internal
parent9137e591fa7d7fee2e8c1d3bfeb55068deb2c665 (diff)
downloadcatch3-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.hpp6
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;
}