I just upgraded a third party library called RogueWave which I use for database functions.
But, I am getting a really silly compile error, and I am not quite sure what it is complaining about:
typedef std::set< EVBusCalOverride > OverrideSet;
OverrideSet overrides;
OverrideSet::iterator itor = this->overrides.begin( );
while( itor != this->overrides.end( ) )
I get an error on the iterator initialization line saying
An object or reference of type "std::set<EVBusCalOverride,std::less<EVBusCalOverride>,std::allocator<EVBusCalOverride> >::iterator"
cannot be initialized with an rvalue of type "std::_Tree<std::_Tset_traits<EVBusCalOverride,std::less<EVBusCalOverride>,std::allocator<EVBusCalOverride>,0> >::const_iterator".
And EVBusCalOverride is just a class
class EVBusCalOverride
{
private:
RWDate overrideDate;
bool businessDay;
};
RWDate is a datetype variable that belongs to the RogueWave libraries.
Am not sure how that affects the iterator initialization. Can anybody point me in the right direction of what might be causing this?
roguewave is a very old library.
Most collections have two types of iterator,
iterator
which allows you to change the members andconst_iterator
which does not.std::set
is an exception to that rule in a sense that you cannot modify the members so all iterators are const. However they still supportiterator
andconst_iterator
, often one being an alias of the other, but roguewave obviously doesn't.Changing
iterator
in your code toconst_iterator
will probably fix, but I would suggest you change your version of STL if possible.