In order to simplify my problem, I'll be using std::unique_lock
as the tool to explain.
std::unique_lock has a template argument, the mutex. However, it's constructor is also a template function unique_lock(TMutex &, const chrono::duration<_Rep, _Period>&)
.
When one uses this, one can write:
auto lock = std::unique_lock(my_mutex, 5s);
So, the question: How to write out the deduction guide for this (without changing behavior), how to do so?
My best attempt upto now:
template<typename _Mutex>
template<typename _Rep, typename _Period>
unique_lock(_Mutex &, const chrono::duration<_Rep, _Period>&) -> unique_lock<_Mutex>;
Unfortunately, clang doesn't accept this:
error: extraneous template parameter list in template specialization or out-of-line template definition