hectorDUQUE
Programmer
- Jan 29, 2007
- 23
hi guys,
please some help with pointers:
this STLplus code is good:
this one has a reference problem:
error: passing ‘const digraph<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, int>’ as ‘this’ argument of ‘typename digraph<NT, AT>::iterator digraph<NT, AT>::insert(const NT&) [with NT = std::basic_string<char, std::char_traits<char>, std::allocator<char> >, AT = int]’ discards qualifiers
the type of insert is:
iterator insert(const NT& node_data);
i am sure this is a easy one for you guys ...
thanks in advance.
hector
please some help with pointers:
this STLplus code is good:
Code:
int main(int argc, char* argv[])
{
digraph<string,int> graph;
digraph<string,int>::iterator node1 = graph.insert("1");
}
this one has a reference problem:
Code:
void initGraph(const digraph<string,int>& graph){
digraph<string,int>::iterator node1 = graph.insert("1");
}
int main(int argc, char* argv[])
{
digraph<string,int> graph;
initGraph(graph);
}
error: passing ‘const digraph<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, int>’ as ‘this’ argument of ‘typename digraph<NT, AT>::iterator digraph<NT, AT>::insert(const NT&) [with NT = std::basic_string<char, std::char_traits<char>, std::allocator<char> >, AT = int]’ discards qualifiers
the type of insert is:
iterator insert(const NT& node_data);
i am sure this is a easy one for you guys ...
thanks in advance.
hector