Question

I am implementing class graph. In similar to stl ,I think ,that the signature of insert function should be

pair<iterator,bool> insert ( const value_type& x );

For my class I have implemented iterator and const_iterator. Should I define 2 i(overloaded) insert functions : one which will return pair<iterator,bool> and the second which will return pair<const_iterator,bool>

Was it helpful?

Solution

No, there's no need. You can't call insert on a const collection anyway.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top