Strange behaivor with GCC when compiling C++ code

Alexander I. Shaykhrazeev alexsh at design.morion.ru
Wed Aug 9 05:44:09 UTC 2006


Greetings,
I had found strange behaivor when compiling my C++ code. There are STL 
container "map" used, but
when i try access elements thru iterator, compiler explains there are 
errors.
Code is very simple, shown below.

--- Code ---
for (map<int, ogmBoard*>::const_iterator it = boards.begin(); it < 
boards.end(); it++)
if (it->monitorable())
        {
            // Мониторинг плат, которые доступны для мониторинга
            it->second->monitor();
            // Проверка статуса после мониторинга
            it->second->getStatus();
        }
------

There are compiler output:
ogm_block.cc: In destructor `virtual ogmBlock::~ogmBlock()':
ogm_block.cc:51: no match for `std::_Rb_tree_iterator<std::pair<const 
uint8_t,
   ogmBoard*>, std::pair<const uint8_t, ogmBoard*>&, std::pair<const 
uint8_t,
   ogmBoard*>*>& < std::_Rb_tree_iterator<std::pair<const uint8_t, 
ogmBoard*>,
   std::pair<const uint8_t, ogmBoard*>&, std::pair<const uint8_t, 
ogmBoard*>*>'
   operator
ogm_block.cc: In member function `signed32 ogmBlock::monitor()':
ogm_block.cc:148: no match for `std::_Rb_tree_iterator<std::pair<const 
uint8_t,
   ogmBoard*>, const std::pair<const uint8_t, ogmBoard*>&, const
   std::pair<const uint8_t, ogmBoard*>*>& <
   std::_Rb_tree_iterator<std::pair<const uint8_t, ogmBoard*>, 
std::pair<const
   uint8_t, ogmBoard*>&, std::pair<const uint8_t, ogmBoard*>*>' operator
ogm_block.cc:150: no matching function for call to `std::pair<const uint8_t,
   ogmBoard*>::monitorable() const'
make[1]: *** [o-optimize/ogm_block.o] Error 1
make[1]: Leaving directory `/home/shaykhrazeev/rtems_apps_ns/ym120m/libprj'
make: *** [all] Error 1

-- 
Alexander I. Shaykhrazeev
Morion Inc.




More information about the users mailing list