C++ 0x has template aliases (sometimes referred to as template typedefs). See here. Current spec of C++ does not.
What do you like to use as work around ? Container objects or Macros ? Do you feel its worth it ?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The canonical way is to use a metafunction like thus:
This is also used in the STL (
allocator::rebind<U>) and in many libraries including Boost. We use it extensively in a bioinformatical library.It’s bloated, but it’s the best alternative 99% of the time. Using macros here is not worth the many downsides.
(EDIT: I’ve amended the code to reflect Boost/STL conventions as pointed out by Daniel in his comment.)