Doh.. doesn't seem to work (with a list<> anyways)
bool WindowPool::screenNumberOfRoot(Window root, int * screennum_return) {
list<Window>::iterator found = find(roots.begin(), roots.end(), root);
if(found == roots.end())
return false;
*screennum_return = found - roots.begin();
return true;
}
I get this nasty complaint:
WindowPool.cc:97: error: no match for 'operator-' in 'found - std::list<_Tp, _Alloc>::begin() [with _Tp = Window, _Alloc = std::allocator<Window>]()'
/usr/include/c++/3.3/bits/stl_bvector.h:147: error: candidates are: ptrdiff_t std:

perator-(const std::_Bit_iterator_base&, const std::_Bit_iterator_base&)
Hmmm.. it seems that iterator subtraction only needs to be supported by random access iterators, which I assume a list<>::iterator is not. Bah.. maybe I'll just use a vector instead.