Skip to content

Commit

Permalink
Committing clang-format changes
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenberry committed Jan 2, 2025
1 parent 4e4446e commit 2377148
Showing 1 changed file with 15 additions and 8 deletions.
23 changes: 15 additions & 8 deletions include/glaze/thread/async_string.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ namespace glz
str.append(sv);
return *this;
}

template <class RHS>
requires(std::same_as<std::remove_cvref_t<RHS>, async_string>)
async_string& append(RHS&& other)
Expand All @@ -205,7 +205,10 @@ namespace glz

template <class RHS>
requires(std::same_as<std::remove_cvref_t<RHS>, std::string>)
async_string& operator+=(RHS&& s) { return append(std::forward<RHS>(s)); }
async_string& operator+=(RHS&& s)
{
return append(std::forward<RHS>(s));
}

async_string& operator+=(const std::string_view& sv) { return append(sv); }

Expand All @@ -215,18 +218,19 @@ namespace glz
str += c;
return *this;
}

void reserve(size_t count) {

void reserve(size_t count)
{
std::unique_lock lock(mutex);
str.reserve(count);
}

void resize(size_t count)
{
std::unique_lock lock(mutex);
str.resize(count);
}

void resize(size_t count, const char ch)
{
std::unique_lock lock(mutex);
Expand Down Expand Up @@ -296,12 +300,15 @@ namespace glz
std::scoped_lock lock{lhs.mutex, rhs.mutex};
return lhs.str == rhs.str;
}

friend bool operator!=(const async_string& lhs, const std::string_view rhs) { return !(lhs == rhs); }

template <class RHS>
requires(std::same_as<std::remove_cvref_t<RHS>, async_string>)
friend bool operator!=(const async_string& lhs, RHS&& rhs) { return !(lhs == rhs); }
friend bool operator!=(const async_string& lhs, RHS&& rhs)
{
return !(lhs == rhs);
}

friend bool operator<(const async_string& lhs, const async_string& rhs)
{
Expand Down

0 comments on commit 2377148

Please sign in to comment.