Topic: Proposed: Class template argument deduction


Author: Boris Rasin <brasin@netvision.net.il>
Date: 1995/07/04
Raw View
I would like to see the following addition to
"Template argument deduction"    temp.deduct   :

In a call to class template constructor, class template
arguments can be deduced from constructor arguments,
under the rules for function template argument deduction.

Example:
        class Mutex { ... };
        class Semaphore { ... };
        template <class T> class Lock { ... };

        Mutex M;
        Semaphore S;
        Lock L1 (M); // Lock<Mutex> L1 (M);
        Lock L2 (S); // Lock<Semaphore> L2 (S);

What do you think?