[thread] lock factory functions?

-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 I'm curious if lock factory functions have been considered? Combined with the C++0x "auto" keyword (or some other kind of type erasure if you wanted to emulate), it seems like they could allow you to avoid having to specify the template type of locks explicitly. Like: template<typename M> boost::unique_lock<M> make_unique_lock(M &mutex); boost::mutex m; auto lock = make_unique_lock(m); -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iD8DBQFIMy3V5vihyNWuA4URAgznAJ9ofZV/KfI0bit9QS6ek5DigfzvjgCgwoyE Y7GuiYLbTDRr+/AdM5JQMQk= =BaOW -----END PGP SIGNATURE-----

Frank Mori Hess <frank.hess@nist.gov> writes:
I'm curious if lock factory functions have been considered? Combined with the C++0x "auto" keyword (or some other kind of type erasure if you wanted to emulate), it seems like they could allow you to avoid having to specify the template type of locks explicitly. Like:
template<typename M> boost::unique_lock<M> make_unique_lock(M &mutex);
boost::mutex m; auto lock = make_unique_lock(m);
I'm not aware that they have, but it does look useful. Anthony -- Anthony Williams | Just Software Solutions Ltd Custom Software Development | http://www.justsoftwaresolutions.co.uk Registered in England, Company Number 5478976. Registered Office: 15 Carrallack Mews, St Just, Cornwall, TR19 7UL
participants (2)
-
Anthony Williams
-
Frank Mori Hess