J
John
I am trying to implement a wrapper on the map
container with no luck. Seems like I'm messing up
something const/non-const but cant figure out the
error...would appreciate ur comments...
Line 40 is [ dic_item tite = tmap.find(k); ]
Error Message:
.../incl/mapdict.hpp:40: error: conversion from `
std::_Rb_tree_iterator<std:
air<const int, int>, const
std:
air<const int,
int>&, const std:
air<const int, int>*>' to non-scalar type `
std::_Rb_tree_iterator<std:
air<const int, int>, std:
air<const
int,
int>&, std:
air<const int, int>*>' requested
-------------simplified code
template <typename K, typename I>
class mapdict
{
std::map<K,I> tmap;
public:
typedef typename std::map<K,I>::iterator dic_item;
dic_item lookup(const K& k) const
{
// The proble is the line below
dic_item tite = tmap.find(k);
//if(tit == tmap.end()) return (dic_item)nil;
return nil;
}
}
container with no luck. Seems like I'm messing up
something const/non-const but cant figure out the
error...would appreciate ur comments...
Line 40 is [ dic_item tite = tmap.find(k); ]
Error Message:
.../incl/mapdict.hpp:40: error: conversion from `
std::_Rb_tree_iterator<std:
std:
int>&, const std:
std::_Rb_tree_iterator<std:
int,
int>&, std:
-------------simplified code
template <typename K, typename I>
class mapdict
{
std::map<K,I> tmap;
public:
typedef typename std::map<K,I>::iterator dic_item;
dic_item lookup(const K& k) const
{
// The proble is the line below
dic_item tite = tmap.find(k);
//if(tit == tmap.end()) return (dic_item)nil;
return nil;
}
}