patch-src_Anyterm.cc 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. After http://github.com/boostorg/range/commit/69409ed63a9e1 build fails:
  2. ../src/Anyterm.cc: In member function 'Anyterm::response_t Anyterm::process_request(const pbe::HttpRequest&)':
  3. ../src/Anyterm.cc:174:74: error: call of overloaded 'distance(std::map<SessionId, boost::shared_ptr<Session> >::const_iterator, std::map<SessionId, boost::shared_ptr<Session> >::const_iterator)' is ambiguous
  4. int n_sessions = distance(sessions_rd->begin(),sessions_rd->end());
  5. ^
  6. In file included from /usr/local/lib/gcc6/include/c++/bits/stl_algobase.h:66:0,
  7. from /usr/local/lib/gcc6/include/c++/bits/stl_tree.h:63,
  8. from /usr/local/lib/gcc6/include/c++/map:60,
  9. from ../src/Anyterm.hh:25,
  10. from ../src/Anyterm.cc:20:
  11. /usr/local/lib/gcc6/include/c++/bits/stl_iterator_base_funcs.h:135:5: note: candidate: typename std::iterator_traits<_Iterator>::difference_type std::distance(_InputIterator, _InputIterator) [with _InputIterator = std::_Rb_tree_const_iterator<std::pair<const SessionId, boost::shared_ptr<Session> > >; typename std::iterator_traits<_Iterator>::difference_type = int]
  12. distance(_InputIterator __first, _InputIterator __last)
  13. ^~~~~~~~
  14. In file included from /usr/local/include/boost/range/distance.hpp:18:0,
  15. from /usr/local/include/boost/range/functions.hpp:21,
  16. from /usr/local/include/boost/range/iterator_range_core.hpp:38,
  17. from /usr/local/include/boost/lexical_cast.hpp:30,
  18. from ../libpbe/include/FileDescriptor.hh:26,
  19. from ../src/Activity.hh:27,
  20. from ../src/Session.hh:39,
  21. from ../src/Anyterm.hh:32,
  22. from ../src/Anyterm.cc:20:
  23. /usr/local/include/boost/iterator/distance.hpp:49:9: note: candidate: typename boost::iterators::iterator_difference<Iterator>::type boost::iterators::distance_adl_barrier::distance(SinglePassIterator, SinglePassIterator) [with SinglePassIterator = std::_Rb_tree_const_iterator<std::pair<const SessionId, boost::shared_ptr<Session> > >; typename boost::iterators::iterator_difference<Iterator>::type = int]
  24. distance(SinglePassIterator first, SinglePassIterator last)
  25. ^~~~~~~~
  26. --- src/Anyterm.cc.orig 2008-11-24 12:45:25 UTC
  27. +++ src/Anyterm.cc
  28. @@ -171,7 +171,7 @@ Anyterm::response_t Anyterm::process_request(const Htt
  29. {
  30. locked_sessions_t::reader sessions_rd(sessions);
  31. - int n_sessions = distance(sessions_rd->begin(),sessions_rd->end());
  32. + int n_sessions = std::distance(sessions_rd->begin(),sessions_rd->end());
  33. if (n_sessions>=max_sessions) {
  34. throw Error("The maximum number of concurrent sessions has been reached");
  35. }