[gtkmm] ArrayHandle request



The following code doesn't work:

void Foo::fileOkClicked(FileSelection *fs) {
  ArrayHandle<string> selections = fs->get_selections();
  ArrayHandle<string>::const_iterator index, end;
  index = selections.begin();
  end = selections.end();
  while (index != end) // do magic
}


The following code does work:

void Foo::fileOkClicked(FileSelection *fs) {
  ArrayHandle<string> selections = fs->get_selections();
  ArrayHandle<string>::const_iterator index = selections.begin();
  ArrayHandle<string>::const_iterator end = selections.end();
  while (index != end) // do magic
}


... Looking at the documentation, apparently const_iterator is a typedef
to a class which requires a CType* to be passed into it, which means
that STL semantics are broken for this particular iterator--you can do

list<foo>::iterator bar
map<foo>::iterator bar
vector<foo>::iterator bar

... etc., but you can't do

ArrayHandle<foo>::iterator bar

How hard would it be to give ArrayHandle iterators STL-like semantics?

-- 
Geek Code: GAT d- s+:+ a27 C++(+++)$ ULB++>++++ P++ L+++>++++ E W+ N+ w
           PS+ PE++ Y++ PGP++ t+ 5++ X-- R tv b+++ DI++ D--- G+ e++ h*
           r* y+* 




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]