File indexing completed on 2025-12-16 10:04:53
0001
0002
0003
0004
0005
0006
0007
0008 #ifndef BOOST_POLYGON_SORT_ADAPTOR_HPP
0009 #define BOOST_POLYGON_SORT_ADAPTOR_HPP
0010 #ifdef __ICC
0011 #pragma warning(disable:2022)
0012 #pragma warning(disable:2023)
0013 #endif
0014
0015 #include <algorithm>
0016
0017
0018 namespace boost {
0019 namespace polygon {
0020
0021 template<typename iterator_type>
0022 struct dummy_to_delay_instantiation{
0023 typedef int unit_type;
0024 };
0025
0026
0027 template<typename T>
0028 struct polygon_sort_adaptor {
0029
0030
0031 template<typename RandomAccessIterator_Type>
0032 static void sort(RandomAccessIterator_Type _First,
0033 RandomAccessIterator_Type _Last)
0034 {
0035 std::sort(_First, _Last);
0036 }
0037
0038
0039 template<typename RandomAccessIterator_Type, typename Pred_Type>
0040 static void sort(RandomAccessIterator_Type _First,
0041 RandomAccessIterator_Type _Last,
0042 const Pred_Type& _Comp)
0043 {
0044 std::sort(_First, _Last, _Comp);
0045 }
0046 };
0047
0048
0049 template <typename iter_type>
0050 void polygon_sort(iter_type _b_, iter_type _e_)
0051 {
0052 polygon_sort_adaptor<typename dummy_to_delay_instantiation<iter_type>::unit_type>::sort(_b_, _e_);
0053 }
0054
0055
0056
0057 template <typename iter_type, typename pred_type>
0058 void polygon_sort(iter_type _b_, iter_type _e_, const pred_type& _pred_)
0059 {
0060 polygon_sort_adaptor<typename dummy_to_delay_instantiation<iter_type>::unit_type>::sort(_b_, _e_, _pred_);
0061 }
0062
0063
0064
0065 }
0066 }
0067 #endif