-
template class problem
Can somebody please tell me, whats wrong with this:
Code:
template <typename T>
class base_record {
public:
typedef std::vector<T> list_type;
list_type const& records() const { return m_records; }
private:
list_type m_records;
list_type::size_type m_position; //the problem is here
};
-
You need to put the keyword typename in front of the declaration in red to indicate to the compiler that size_type is a type.
-
-
You didn't say what error you're getting if any, but without trying to compile it, I'd say try this:
Code:
typename list_type::size_type m_position;
-
Solution suggested and implemented and problem solved before you could add colour to your response. :)
More information about typename: http://publib.boulder.ibm.com/infoce...d_typename.htm