R
Richard van Wegen
Dear All
I'm hoping someone can show me the correct way to typedef a template
class -
i.e. something along the lines of
typedef boost::shared_ptr<T> shared_ptr_multithread<T>;
(syntax is obviously wrong but you get the idea)
i.e. I want to be able to write
int main()
{
shared_ptr_multithread<MyClass> my_class_multithreaded_ptr;
shared_ptr<MyClass> my_class_singlethreaded_ptr;
}
so that for the time being it is equivalent to
int main()
{
shared_ptr<MyClass> my_class_multithreaded_ptr;
shared_ptr<MyClass> my_class_singlethreaded_ptr;
}
but later on I can change the way that shared_ptr_multithread<MyClass>
is
implemented without affecting all my other shared_ptr<MyClass>
declarations.
I'm sure it must be simple, but I can't find the syntax for it
anywhere and I've tried all the combinations of "template" and
"typename" etc I can think of with no success. (GCC 2.96). At the
moment I'm forced to rely on #define (eugh).
Thanks for any pointers!
Richard
I'm hoping someone can show me the correct way to typedef a template
class -
i.e. something along the lines of
typedef boost::shared_ptr<T> shared_ptr_multithread<T>;
(syntax is obviously wrong but you get the idea)
i.e. I want to be able to write
int main()
{
shared_ptr_multithread<MyClass> my_class_multithreaded_ptr;
shared_ptr<MyClass> my_class_singlethreaded_ptr;
}
so that for the time being it is equivalent to
int main()
{
shared_ptr<MyClass> my_class_multithreaded_ptr;
shared_ptr<MyClass> my_class_singlethreaded_ptr;
}
but later on I can change the way that shared_ptr_multithread<MyClass>
is
implemented without affecting all my other shared_ptr<MyClass>
declarations.
I'm sure it must be simple, but I can't find the syntax for it
anywhere and I've tried all the combinations of "template" and
"typename" etc I can think of with no success. (GCC 2.96). At the
moment I'm forced to rely on #define (eugh).
Thanks for any pointers!
Richard