C++ template + typedef

Posted by MMS on Stack Overflow See other posts from Stack Overflow or by MMS
Published on 2010-12-21T17:45:09Z Indexed on 2010/12/21 17:54 UTC
Read the original article Hit count: 131

Filed under:
|
|

What is wrong in the following code:

Point2D.h

template <class T> 
class Point2D 
{     
   private:
         T x;
         T y; 
   ... 
 };

PointsList.h

template <class T>
class Point2D;

template <class T>
struct TPointsList
{
    typedef std::vector <Point2D <T> > Type;
};

template <class T>
class PointsList
{
    private:
            TPointsList <T>::Type points;  //Compiler error
 ...
};

I would like to create new user type TPointsList without direct type specification...

© Stack Overflow or respective owner

Related posts about c++

Related posts about templates