Constify the type passed to std::equal_to.

std::bind2nd() has problems with the existing call because it uses the
argument type passed to std::equal_to() in std::binder2nd()'s constructor,
but WinClient* does not have the const specifier that `client' does.

The call works fine with libstdc++ because of the way it implements
std::bind2nd(), but fails with libc++ and possibly with other STL
implementations as well.
This commit is contained in:
Raphael Kubo da Costa 2013-06-29 20:24:39 +03:00 committed by Mathias Gumz
parent f464f24eb3
commit 0084149c3d

View file

@ -1359,7 +1359,7 @@ bool Fluxbox::validateClient(const WinClient *client) const {
WinClientMap::const_iterator it = WinClientMap::const_iterator it =
find_if(m_window_search.begin(), find_if(m_window_search.begin(),
m_window_search.end(), m_window_search.end(),
Compose(bind2nd(equal_to<WinClient *>(), client), Compose(bind2nd(equal_to<const WinClient *>(), client),
Select2nd<WinClientMap::value_type>())); Select2nd<WinClientMap::value_type>()));
return it != m_window_search.end(); return it != m_window_search.end();
} }