By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,750 Members | 1,199 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,750 IT Pros & Developers. It's quick & easy.

C++ Template, - "non-type" error

P: n/a
Can someone explain this error to me? :

main.cpp:9: instantiated from `void show(const LIST::List<T>&) [with T =
int]'
main.cpp:23: instantiated from here
list.cpp:58: error: dependent-name `LIST::List<T>::ListIterator' is parsed
as a non-type, but instantiation yields a type
..........

This is the first part of the main:

#include "list.h"
#include <iostream>
using namespace std;
using namespace LIST;
template <typename T>

void show(const List<T>& m) {
for(List<T>::ListIterator i = m.begin(); i != m.end(); ++i) cout << *i;
}

------------------------

Thanks

Mat
Jul 23 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Mat DeLong wrote:
Can someone explain this error to me? :

main.cpp:9: instantiated from `void show(const LIST::List<T>&) [with T =
int]'
main.cpp:23: instantiated from here
list.cpp:58: error: dependent-name `LIST::List<T>::ListIterator' is parsed
as a non-type, but instantiation yields a type
.........

This is the first part of the main:

#include "list.h"
#include <iostream>
using namespace std;
using namespace LIST;
template <typename T>

void show(const List<T>& m) {
for(List<T>::ListIterator i = m.begin(); i != m.end(); ++i) cout << *i; ^
Add 'typename' here.
}

------------------------


V
Jul 23 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.