Skip to content

Commit

Permalink
use C++11 minmax_element (#3522)
Browse files Browse the repository at this point in the history
  • Loading branch information
rfranke committed Oct 21, 2015
1 parent cfc7caf commit 4eede18
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion SimulationRuntime/cpp/Core/Math/ArrayOperations.cpp
Expand Up @@ -405,7 +405,7 @@ std::pair<T,T> min_max(const BaseArray<T>& x)
{
const T* data = x.getData();
std::pair<const T*, const T*>
ret = boost::minmax_element(data, data + x.getNumElems());
ret = minmax_element(data, data + x.getNumElems());
return std::make_pair(*(ret.first), *(ret.second));
}

Expand Down
10 changes: 4 additions & 6 deletions SimulationRuntime/cpp/Include/Core/Modelica.h
Expand Up @@ -11,6 +11,7 @@
#include <map>
#include <cmath>
#include <numeric>
#include <functional>

#include <boost/assign/std/vector.hpp> // for 'operator+=()'
#include <boost/assign/list_of.hpp> // for 'list_of()'
Expand All @@ -30,9 +31,7 @@
#include <boost/preprocessor/punctuation/comma_if.hpp>
#include <boost/preprocessor/repetition.hpp>
#include <boost/preprocessor/iteration/iterate.hpp>
#include <boost/algorithm/minmax_element.hpp>
#include <boost/weak_ptr.hpp>
#include <functional>
#include <boost/range/irange.hpp>
#define BOOST_UBLAS_SHALLOW_ARRAY_ADAPTOR
#include <boost/numeric/ublas/vector.hpp>
Expand All @@ -45,8 +44,6 @@
#include <boost/range/algorithm/copy.hpp>
#include <boost/math/special_functions/trunc.hpp>
#include <boost/assert.hpp>
#include <boost/algorithm/minmax_element.hpp>
#include <functional>
#include <boost/unordered_map.hpp>
#include <boost/assign/list_inserter.hpp>
#include <boost/ptr_container/ptr_vector.hpp>
Expand Down Expand Up @@ -109,8 +106,8 @@ using std::runtime_error;
using std::condition_variable;
using std::unique_lock;
using std::make_tuple;

using std::array;
using std::minmax_element;
using std::tuple;
using std::shared_ptr;
using std::weak_ptr;
Expand All @@ -126,6 +123,7 @@ using std::runtime_error;
using boost::make_tuple;
#endif
#include <boost/array.hpp>
#include <boost/algorithm/minmax_element.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/weak_ptr.hpp>

Expand All @@ -146,7 +144,7 @@ using std::runtime_error;
#endif //USE_THREAD

using boost::array;

using boost::minmax_element;
using boost::shared_ptr;
using boost::weak_ptr;
using boost::dynamic_pointer_cast;
Expand Down

0 comments on commit 4eede18

Please sign in to comment.