Re: template typedef
- From: "Igor Tandetnik" <itandetnik@xxxxxxxx>
- Date: Mon, 22 Sep 2008 07:11:10 -0400
"Alessandro Vergani" <avergani@xxxxxxxxxxx> wrote in message
news:4FC7D387-AA48-4DCC-9138-ED2387A7811B@xxxxxxxxxxxxx
suppose I have a template class like:
template <typename T>
struct X
{
T value;
};
If I need a shared_ptr to this class I declare it like:
std::tr1::shared_ptr<X<char>> XcharPtr;
Is there a way to typedef the first part, so I can do something like:
typedXptr<char> XcharPtr;
There will be, in the next version of the standard. For now, the closest
you can get is something like this:
template <typename T>
struct typedXptr {
typedef shared_ptr<X<T> > type;
};
typedXptr<char>::type XcharPtr;
--
With best wishes,
Igor Tandetnik
With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925
.
- Follow-Ups:
- Re: template typedef
- From: Alessandro Vergani
- Re: template typedef
- References:
- template typedef
- From: Alessandro Vergani
- template typedef
- Prev by Date: Re: virtual function call issue
- Next by Date: Re: use customized data type in IDispatch.Invoke
- Previous by thread: template typedef
- Next by thread: Re: template typedef
- Index(es):
Relevant Pages
|