stl::set

Posted by Benjamin Close on November 13, 2008 under Programming | 3 Comments to Read

Working with Mark’s dnl code, we came across an interesting issue. Mark had used the stl::set class for some of his code and whilst it compiled fine under Visual Studio, it failed to compile under gcc/g++. With the error: dnlCommon/Logger.cpp: In member function ‘void dnlCommon::Logger::setMask(std::ostream&, std::bitset<5ul>)’: dnlCommon/Logger.cpp:64: error: invalid initialization of reference of type ‘dnlCommon::Logger::LoggerPair&’ [..more..]

Stl::reverse iterator

Posted by Benjamin Close on under Programming | Be the First to Comment

I was coding a little program a while back when I found a Quirk about the stl reverse_iterator. Use of the iterator is quite easy until you have to delete from one. I tried the normal way of: vector<sometype>::reverse_iterator myiterator… .. .. myvector.erase(myiterator). only to find the code didn’t compile. A little baffled I started [..more..]