Suppose you have the class given below:
#include #include
In the above definition, the template argument for list is another template class namely, pair. The above definition won’t compile. For ex, VC++ 6.0 gives the following error:
syntax error : missing ',' before identifier 'list_of_pairs'
The correct way to declare the above is by using a typedef as given below:
typedef std::pair int_pair;std::list list_of_pairs;