Skip to content

Commit

Permalink
refactor(lock): simplify assign constraint
Browse files Browse the repository at this point in the history
* This fixes a bug in Clang >= 17, see: llvm/llvm-project#74447
  • Loading branch information
Curve committed Dec 29, 2023
1 parent c3a0063 commit 50bc274
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion include/lockpp/lock.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ namespace lockpp
public:
template <typename O>
void assign(O &&value) &
requires std::assignable_from<Type &, decltype(std::forward<O>(value))>;
requires std::assignable_from<Type &, O>;

public:
[[nodiscard]] Type &get_unsafe() &;
Expand Down
2 changes: 1 addition & 1 deletion include/lockpp/lock.inl
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ namespace lockpp
template <typename Type, decayed Mutex>
template <typename O>
void lock<Type, Mutex>::assign(O &&value) &
requires std::assignable_from<Type &, decltype(std::forward<O>(value))>
requires std::assignable_from<Type &, O>
{
auto locked = write();
*locked = std::forward<O>(value);
Expand Down

0 comments on commit 50bc274

Please sign in to comment.