Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace Boost::foreach dependency with range-based for #465

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
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
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