hectorDUQUE
Programmer
- Jan 29, 2007
- 23
hi guys,
i have sintax problems using a STL find function :-(
i am trying to match info between two maps.
the find function (STL searching algorithm) has this message in compilation time:
i wonder if i can use the find STL seaching algortihm with maps?
thanks in advance for help.
hector
i have sintax problems using a STL find function :-(
Code:
typedef std::set<string> groupOfFileNames_type;
typedef std::map<string, groupOfFileNames_type> map_groupFN_type;
typedef std::vector<string> resultsGroups_type;
typedef std::map<string, resultsGroups_type> map_completeGroups2resultsGroupsByOrders_type;
map_groupFN_type completeGroup2groups;
map_group_type group2numbers;
for (map_groupFN_type::const_iterator cur_node = completeGroup2groups.begin(),
end_node = completeGroup2groups.end(); cur_node != end_node; ++cur_node)
{
for (groupOfFileNames_type::const_iterator cur_edge = cur_node->second.begin(),
end_edge = cur_node->second.end(); cur_edge != end_edge; ++cur_edge)
{
map_group_type::const_iterator group2numbersIterator;
map_group_type::const_iterator group2numbersNode0x = group2numbers.begin();
map_group_type::const_iterator group2numbersNodeNx = group2numbers.end();
group2numbersIterator = find (group2numbersNode0x, group2numbersNodeNx, "something");
}//for
}//for
i am trying to match info between two maps.
the find function (STL searching algorithm) has this message in compilation time:
Code:
adResultGroupsFIND.Tpo -c hD_loadResultGroupsFIND.cxx -fPIC -DPIC -o .libs/hD_loadResultGroupsFIND.o
/usr/lib/gcc/i386-redhat-linux/4.1.1/../../../../include/c++/4.1.1/bits/stl_algo.h: In function '_InputIterator std::__find(_InputIterator, _InputIterator, const _Tp&, std::input_iterator_tag) [with _InputIterator = std::_Rb_tree_const_iterator<std::pair<const std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::set<int, std::less<int>, std::allocator<int> > > >, _Tp = char [9]]':
/usr/lib/gcc/i386-redhat-linux/4.1.1/../../../../include/c++/4.1.1/bits/stl_algo.h:316: instantiated from '_InputIterator std::find(_InputIterator, _InputIterator, const _Tp&) [with _InputIterator = std::_Rb_tree_const_iterator<std::pair<const std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::set<int, std::less<int>, std::allocator<int> > > >, _Tp = char [9]]'
hD_loadResultGroupsFIND.cxx:57: instantiated from here
/usr/lib/gcc/i386-redhat-linux/4.1.1/../../../../include/c++/4.1.1/bits/stl_algo.h:173: error: no match for 'operator==' in '__first. std::_Rb_tree_const_iterator<_Tp>::operator* [with _Tp = std::pair<const std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::set<int, std::less<int>, std::allocator<int> > >]() == __val'
make[2]: *** [hD_loadResultGroupsFIND.lo] Error 1
make[2]: Leaving directory `/home/duque32/hD_projects/hD_rouletteGambler/map'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/duque32/hD_projects/hD_rouletteGambler'
make: *** [all] Error 2
i wonder if i can use the find STL seaching algortihm with maps?
thanks in advance for help.
hector