Fix const-correctness bugs in uniq_ptr and code that uses it

This commit is contained in:
Cameron Gutman
2023-05-11 01:17:54 -05:00
parent 0fa406dbb7
commit fabadaad2a
4 changed files with 8 additions and 7 deletions

View File

@@ -490,6 +490,7 @@ namespace util {
public:
using element_type = T;
using pointer = element_type *;
using const_pointer = element_type const *;
using deleter_type = D;
constexpr uniq_ptr() noexcept:
@@ -563,12 +564,12 @@ namespace util {
return _p;
}
const pointer
const_pointer
get() const {
return _p;
}
const std::add_lvalue_reference_t<element_type>
std::add_lvalue_reference_t<element_type const>
operator*() const {
return *_p;
}
@@ -576,7 +577,7 @@ namespace util {
operator*() {
return *_p;
}
const pointer
const_pointer
operator->() const {
return _p;
}