1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- #ifndef BOOST_GEOMETRY_INDEX_DETAIL_ALGORITHMS_NTH_ELEMENT_HPP
- #define BOOST_GEOMETRY_INDEX_DETAIL_ALGORITHMS_NTH_ELEMENT_HPP
- #include <algorithm>
- namespace boost { namespace geometry { namespace index { namespace detail {
- #if defined(__GLIBCXX__) && (__GLIBCXX__ == 20131016)
- #warning "std::nth_element replaced with std::sort, libstdc++ bug workaround.";
- template <typename RandomIt>
- void nth_element(RandomIt first, RandomIt , RandomIt last)
- {
- std::sort(first, last);
- }
- template <typename RandomIt, typename Compare>
- void nth_element(RandomIt first, RandomIt , RandomIt last, Compare comp)
- {
- std::sort(first, last, comp);
- }
- #else
- template <typename RandomIt>
- void nth_element(RandomIt first, RandomIt nth, RandomIt last)
- {
- std::nth_element(first, nth, last);
- }
- template <typename RandomIt, typename Compare>
- void nth_element(RandomIt first, RandomIt nth, RandomIt last, Compare comp)
- {
- std::nth_element(first, nth, last, comp);
- }
- #endif
- }}}}
- #endif
|