summaryrefslogtreecommitdiff
path: root/asl/strings
diff options
context:
space:
mode:
authorSteven Le Rouzic <steven.lerouzic@gmail.com>2025-03-06 22:56:56 +0100
committerSteven Le Rouzic <steven.lerouzic@gmail.com>2025-03-06 22:56:56 +0100
commitf0cccbe3285c039553e1fd8b5a5c7830d6087974 (patch)
tree57a0902484ec5c8ba3b9a8e7089ed42f58b6a580 /asl/strings
parent54affafd86e2b7f387345c08e8c7285c775d75e5 (diff)
Replace ASL_MOVE, ASL_FWD, and ASL_FWD_LIKE by their std:: equivalent
This is because some compiler stuff and diagnostics tools rely on those symboles being what they are.
Diffstat (limited to 'asl/strings')
-rw-r--r--asl/strings/string.hpp6
-rw-r--r--asl/strings/string_builder.hpp24
2 files changed, 15 insertions, 15 deletions
diff --git a/asl/strings/string.hpp b/asl/strings/string.hpp
index c2f199f..0f70228 100644
--- a/asl/strings/string.hpp
+++ b/asl/strings/string.hpp
@@ -16,7 +16,7 @@ class string
buffer<char, Allocator> m_buffer;
explicit constexpr string(buffer<char, Allocator>&& buffer) :
- m_buffer{ASL_MOVE(buffer)}
+ m_buffer{std::move(buffer)}
{}
template<allocator A>
@@ -24,7 +24,7 @@ class string
public:
constexpr string() requires default_constructible<Allocator> = default;
- explicit constexpr string(Allocator allocator) : m_buffer{ASL_MOVE(allocator)} {}
+ explicit constexpr string(Allocator allocator) : m_buffer{std::move(allocator)} {}
// NOLINTNEXTLINE(*-explicit-conversions)
constexpr string(string_view sv)
@@ -33,7 +33,7 @@ public:
{}
constexpr string(string_view sv, Allocator allocator)
- : m_buffer{sv.as_span(), ASL_MOVE(allocator)}
+ : m_buffer{sv.as_span(), std::move(allocator)}
{}
constexpr ~string() = default;
diff --git a/asl/strings/string_builder.hpp b/asl/strings/string_builder.hpp
index c8bb4d8..eed9e6a 100644
--- a/asl/strings/string_builder.hpp
+++ b/asl/strings/string_builder.hpp
@@ -20,7 +20,7 @@ class StringBuilder
public:
constexpr StringBuilder() requires default_constructible<Allocator> = default;
- explicit constexpr StringBuilder(Allocator allocator) : m_buffer{ASL_MOVE(allocator)} {}
+ explicit constexpr StringBuilder(Allocator allocator) : m_buffer{std::move(allocator)} {}
constexpr ~StringBuilder() = default;
@@ -44,23 +44,23 @@ public:
auto push(this auto&& self, string_view sv) -> decltype(self)
requires (!is_const<un_ref_t<decltype(self)>>)
{
- isize_t old_size = self.m_buffer.size();
+ const isize_t old_size = self.m_buffer.size();
self.m_buffer.resize_zero(old_size + sv.size());
// NOLINTNEXTLINE(*-pointer-arithmetic)
asl::memcpy(self.m_buffer.data() + old_size, sv.data(), sv.size());
- return ASL_FWD(self);
+ return std::forward<decltype(self)>(self);
}
auto push(this auto&& self, char c) -> decltype(self)
requires (!is_const<un_ref_t<decltype(self)>>)
{
self.m_buffer.push(c);
- return ASL_FWD(self);
+ return std::forward<decltype(self)>(self);
}
string<Allocator> finish() &&
{
- return string<Allocator>{ASL_MOVE(m_buffer)};
+ return string<Allocator>{std::move(m_buffer)};
}
template<allocator StringAllocator = Allocator>
@@ -73,7 +73,7 @@ public:
template<allocator StringAllocator = Allocator>
string<StringAllocator> as_string(Allocator allocator) const
{
- return string<StringAllocator>{as_string_view(), ASL_MOVE(allocator)};
+ return string<StringAllocator>{as_string_view(), std::move(allocator)};
}
};
@@ -86,7 +86,7 @@ class StringWriter : public asl::Writer
public:
constexpr StringWriter() requires default_constructible<Allocator> = default;
- explicit constexpr StringWriter(Allocator allocator) : m_builder{ASL_MOVE(allocator)} {}
+ explicit constexpr StringWriter(Allocator allocator) : m_builder{std::move(allocator)} {}
constexpr ~StringWriter() override = default;
@@ -108,7 +108,7 @@ public:
string<Allocator> finish() &&
{
- return ASL_MOVE(m_builder).finish();
+ return std::move(m_builder).finish();
}
template<allocator StringAllocator = Allocator>
@@ -121,7 +121,7 @@ public:
template<allocator StringAllocator = Allocator>
string<StringAllocator> as_string(Allocator allocator) const
{
- return m_builder.as_string(ASL_MOVE(allocator));
+ return m_builder.as_string(std::move(allocator));
}
};
@@ -133,15 +133,15 @@ string<Allocator> format_to_string(string_view fmt, const formattable auto&... a
{
StringWriter writer{};
format(&writer, fmt, args...);
- return ASL_MOVE(writer).finish();
+ return std::move(writer).finish();
}
template<allocator Allocator = DefaultAllocator>
string<Allocator> format_to_string(Allocator allocator, string_view fmt, const formattable auto&... args)
{
- StringWriter writer{ASL_MOVE(allocator)};
+ StringWriter writer{std::move(allocator)};
format(&writer, fmt, args...);
- return ASL_MOVE(writer).finish();
+ return std::move(writer).finish();
}
} // namespace asl