YAKOVM
YAKOVM

Reputation: 10153

insert returning iterator

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>

Upvotes: 1

Views: 104

Answers (1)

David Schwartz
David Schwartz

Reputation: 182769

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

Upvotes: 2

Related Questions