File indexing completed on 2025-01-18 09:35:29
0001
0002
0003
0004
0005
0006
0007
0008
0009 #ifndef BOOST_GEOMETRY_INDEX_DETAIL_ALGORITHMS_NTH_ELEMENT_HPP
0010 #define BOOST_GEOMETRY_INDEX_DETAIL_ALGORITHMS_NTH_ELEMENT_HPP
0011
0012 #include <algorithm>
0013
0014 namespace boost { namespace geometry { namespace index { namespace detail {
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028 #if defined(__GLIBCXX__) && (__GLIBCXX__ == 20131016)
0029
0030 #warning "std::nth_element replaced with std::sort, libstdc++ bug workaround.";
0031
0032 template <typename RandomIt>
0033 void nth_element(RandomIt first, RandomIt , RandomIt last)
0034 {
0035 std::sort(first, last);
0036 }
0037
0038 template <typename RandomIt, typename Compare>
0039 void nth_element(RandomIt first, RandomIt , RandomIt last, Compare comp)
0040 {
0041 std::sort(first, last, comp);
0042 }
0043
0044 #else
0045
0046 template <typename RandomIt>
0047 void nth_element(RandomIt first, RandomIt nth, RandomIt last)
0048 {
0049 std::nth_element(first, nth, last);
0050 }
0051
0052 template <typename RandomIt, typename Compare>
0053 void nth_element(RandomIt first, RandomIt nth, RandomIt last, Compare comp)
0054 {
0055 std::nth_element(first, nth, last, comp);
0056 }
0057
0058 #endif
0059
0060 }}}}
0061
0062 #endif