Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Replace Boost::foreach dependency with range-based for
  • Loading branch information
georgthegreat committed Dec 21, 2024
commit 3f70bf4d3b4193ea7d05b2c1c940c8310e5abc6f
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ target_link_libraries(${_boost_python}
Boost::conversion
Boost::core
Boost::detail
Boost::foreach
Boost::function
Boost::iterator
Boost::lexical_cast
Expand Down
1 change: 0 additions & 1 deletion build.jam
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ constant boost_dependencies :
/boost/conversion//boost_conversion
/boost/core//boost_core
/boost/detail//boost_detail
/boost/foreach//boost_foreach
/boost/function//boost_function
/boost/iterator//boost_iterator
/boost/lexical_cast//boost_lexical_cast
Expand Down
13 changes: 4 additions & 9 deletions include/boost/python/suite/indexing/container_utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,21 @@
# define PY_CONTAINER_UTILS_JDG20038_HPP

# include <utility>
# include <boost/foreach.hpp>
# include <boost/python/object.hpp>
# include <boost/python/handle.hpp>
# include <boost/python/extract.hpp>
# include <boost/python/stl_iterator.hpp>

namespace boost { namespace python { namespace container_utils {

template <typename Container>
void
extend_container(Container& container, object l)
{
typedef typename Container::value_type data_type;

// l must be iterable
BOOST_FOREACH(object elem,
std::make_pair(
boost::python::stl_input_iterator<object>(l),
boost::python::stl_input_iterator<object>()
))
for (object elem: l)
{
extract<data_type const&> x(elem);
// try if elem is an exact data_type type
Expand All @@ -49,7 +44,7 @@ namespace boost { namespace python { namespace container_utils {
throw_error_already_set();
}
}
}
}
}

}}} // namespace boost::python::container_utils
Expand Down