I wanted to do
typedef deque type; //error, use of class template requires template argument list type<int> container_;
But this mistake bothers me. How to do it?
You cannot (before C ++ 0x). But it can be emulated with:
template<typename T> struct ContainerOf { typedef std::deque<T> type; };
used as:
ContainerOf<int>::type container_;
deque is not a type. This is the pattern used to generate the type when specifying the argument.
deque<int>
- type, so you can do
typedef deque<int> container_
, ++ typedef. , , :
typedef std::deque <int> IntDeque;
, , int deque.
: typedef ++ 0x. g++
:
#define type deque
But this is due to several drawbacks.