Skip to content

Commit

Permalink
[libc] Add template deduction guide for cpp::lock_guard. (#91589)
Browse files Browse the repository at this point in the history
Fix ctad-maybe-unsupported warnings for `cpp::lock_guard`.
  • Loading branch information
lntue authored May 9, 2024
1 parent e88ba6d commit 6f1013a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions libc/src/__support/CPP/mutex.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ template <typename MutexType> class lock_guard {
lock_guard(const lock_guard &) = delete;
};

// Deduction guide for lock_guard to suppress CTAD warnings.
template <typename T> lock_guard(T &) -> lock_guard<T>;

} // namespace cpp
} // namespace LIBC_NAMESPACE

Expand Down

0 comments on commit 6f1013a

Please sign in to comment.