Does C++0x have (or was C++0x at some point in time going to have) template argument deduction for constructors? In An Overview of the Coming C++ (C++0x) Standard, I saw the following lines:
std::lock_guard l(m); // at 7:00
std::thread t(f); // at 9:00
Does this mean that delegating make_foo function templates are finally redundant?
Template argument deduction works for any function, including the constructor. But you can’t deduce the class template parameters from arguments passed to the constructor. And no, you can’t do it in
C++0x either.
lock_guardandthreadaren’t class templates. They have constructor templates though.