Re: problem with template
"bite" <anonimo.passante@gmail.com> a ?crit dans le message de news:
a6f1c66d-5a5f-4670-a61d-9604780df0c3@d10g2000yqh.googlegroups.com...
On 29 Set, 18:45, Noah Roberts <d...@reply.com> wrote:
In article <c4e7b0bc-472b-4e44-989a-6e19b328bed6
@m38g2000yqd.googlegroups.com>, anonimo.passa...@gmail.com says...
Anybody could tell me what is wrong with these few lines of code?
#include <map>
#include <vector>
template<class Key, class Value>
#include <map>
#include <vector>
template<class Key, class Value>
class PointerVector : public std::vector<Value *>
{
public:
PointerVector () {}
PointerVector (std::map<Key, Value> & as) : std::vector<Value *>
(as.size ())
{
int i = 0;
std::map<Key, Value>::iterator it;
prefix the above line with "typename".
Wonderful, thank you very much.
Now I'll try to learn what 'typename' is :)
It is to clarify that an identifier inside a template is a type.
Eric Pruneau