Skip to content

Commit af36fcf

Browse files
committed
to address
1 parent 9f0eb53 commit af36fcf

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

include/dice/template-library/static_string.hpp

+7-4
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ namespace dice::template_library {
4747
: size_{sv.size()}, alloc_{alloc} {
4848

4949
data_ = std::allocator_traits<allocator_type>::allocate(alloc_, size_);
50-
memcpy(data_, sv.data(), size_);
50+
memcpy(std::to_address(data_), sv.data(), size_);
5151
}
5252

5353
basic_static_string(basic_static_string const &) = delete;
@@ -82,7 +82,7 @@ namespace dice::template_library {
8282
data_ = std::allocator_traits<allocator_type>::allocate(alloc_, size_);
8383
}
8484

85-
memcpy(data_, other.data_, size_);
85+
memcpy(std::to_address(data_), other.data_, size_);
8686
return *this;
8787
}
8888
}
@@ -94,10 +94,13 @@ namespace dice::template_library {
9494
}
9595

9696
operator view_type() const noexcept {
97-
return {data_, size_};
97+
return {std::to_address(data_), size_};
9898
}
9999

100-
[[nodiscard]] value_type const *data() const noexcept {
100+
[[nodiscard]] const_pointer data() const noexcept {
101+
return data_;
102+
}
103+
[[nodiscard]] pointer data() noexcept {
101104
return data_;
102105
}
103106

0 commit comments

Comments
 (0)