summaryrefslogtreecommitdiff
path: root/asl/containers/buffer.hpp
diff options
context:
space:
mode:
authorSteven Le Rouzic <steven.lerouzic@gmail.com>2025-05-14 00:23:11 +0200
committerSteven Le Rouzic <steven.lerouzic@gmail.com>2025-05-14 00:41:51 +0200
commitf7a2699ac0cbb2824862439a72f23013436484de (patch)
tree8e8c63332b8b4ae188a3f41391cadf16145bbed5 /asl/containers/buffer.hpp
parent088e03708afe4145a1903f0b20c53cab1899ad50 (diff)
Add and use copy_const_t
Diffstat (limited to 'asl/containers/buffer.hpp')
-rw-r--r--asl/containers/buffer.hpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/asl/containers/buffer.hpp b/asl/containers/buffer.hpp
index d61abf9..0e30745 100644
--- a/asl/containers/buffer.hpp
+++ b/asl/containers/buffer.hpp
@@ -392,7 +392,7 @@ public:
auto data(this auto&& self)
{
- using return_type = un_ref_t<copy_cref_t<decltype(self), T>>*;
+ using return_type = copy_const_t<un_ref_t<decltype(self)>, T>*;
// NOLINTNEXTLINE(*-reinterpret-cast)
auto&& buffer = reinterpret_cast<copy_cref_t<decltype(self), class buffer>>(self);
if constexpr (kInlineCapacity == 0)
@@ -410,13 +410,13 @@ public:
constexpr auto begin(this auto&& self)
{
- using type = un_ref_t<copy_cref_t<decltype(self), T>>;
+ using type = copy_const_t<un_ref_t<decltype(self)>, T>;
return contiguous_iterator<type>{self.data()};
}
constexpr auto end(this auto&& self)
{
- using type = un_ref_t<copy_cref_t<decltype(self), T>>;
+ using type = copy_const_t<un_ref_t<decltype(self)>, T>;
return contiguous_iterator<type>{self.data() + self.size()};
}
@@ -432,7 +432,7 @@ public:
constexpr auto as_span(this auto&& self)
{
- using type = un_ref_t<copy_cref_t<decltype(self), T>>;
+ using type = copy_const_t<un_ref_t<decltype(self)>, T>;
return span<type>{self.data(), self.size()};
}