Skip to content

Commit

Permalink
add deduction guide for folly::upgrade_lock
Browse files Browse the repository at this point in the history
Summary: Like the deduction guide for folly::hybrid_lock

Reviewed By: dmm-fb

Differential Revision: D51314950

fbshipit-source-id: 7407079f54023ef1c7018aa658bb629965632636
  • Loading branch information
yfeldblum authored and facebook-github-bot committed Nov 15, 2023
1 parent 84f6f3e commit 8da0cb9
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion third-party/folly/src/folly/synchronization/Lock.h
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,11 @@ class upgrade_lock : public upgrade_lock_base<Mutex> {
using upgrade_lock_base<Mutex>::upgrade_lock_base;
};

#if FOLLY_HAS_DEDUCTION_GUIDES || defined(_MSC_VER)
template <typename Mutex, typename... A>
explicit upgrade_lock(Mutex&, A const&...) -> upgrade_lock<Mutex>;
#endif

// hybrid_lock
//
// A lock-holder type which holds shared locks for shared mutex types or
Expand All @@ -506,7 +511,7 @@ class hybrid_lock : public hybrid_lock_base<Mutex> {
using hybrid_lock_base<Mutex>::hybrid_lock_base;
};

#if __cpp_deduction_guides >= 201611
#if FOLLY_HAS_DEDUCTION_GUIDES || defined(_MSC_VER)
template <typename Mutex, typename... A>
explicit hybrid_lock(Mutex&, A const&...) -> hybrid_lock<Mutex>;
#endif
Expand Down

0 comments on commit 8da0cb9

Please sign in to comment.