A
Alex Snast
Hello guys,
I can't seem to be able to get accsess to a type i declared within a
template class i.e.
template <typename T>
class Array {
public:
typedef std::size_t size_type;
....
....
size_type size() const;
....
private:
....
};
Now i want to implement the size method outside on the class so:
template <typename T>
size_type Array<T>::size() const { ... }
now i know that i can't just use "size_type" but using something like
Array<T>::size_type or Array::size_type can't seem to work either,
however writing T works just fine.
My question is how can i use my typedef size_type outside of the class
declaration?
Any help would be much appreciated, Alex
I can't seem to be able to get accsess to a type i declared within a
template class i.e.
template <typename T>
class Array {
public:
typedef std::size_t size_type;
....
....
size_type size() const;
....
private:
....
};
Now i want to implement the size method outside on the class so:
template <typename T>
size_type Array<T>::size() const { ... }
now i know that i can't just use "size_type" but using something like
Array<T>::size_type or Array::size_type can't seem to work either,
however writing T works just fine.
My question is how can i use my typedef size_type outside of the class
declaration?
Any help would be much appreciated, Alex