File indexing completed on 2025-01-18 09:35:47
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010 #ifndef BOOST_GEOMETRY_PROJECTIONS_CODE_HPP
0011 #define BOOST_GEOMETRY_PROJECTIONS_CODE_HPP
0012
0013
0014 #include <algorithm>
0015
0016 #include <boost/geometry/srs/projections/dpar.hpp>
0017
0018
0019 namespace boost { namespace geometry { namespace projections
0020 {
0021
0022
0023 #ifndef DOXYGEN_NO_DETAIL
0024 namespace detail
0025 {
0026
0027 struct code_element
0028 {
0029 int code;
0030 srs::dpar::parameters<> parameters;
0031 };
0032
0033 struct code_element_less
0034 {
0035 inline bool operator()(code_element const& l, code_element const& r) const
0036 {
0037 return l.code < r.code;
0038 }
0039 };
0040
0041 template<typename RandIt>
0042 inline RandIt binary_find_code_element(RandIt first, RandIt last, int code)
0043 {
0044 code_element_less comp;
0045 code_element value;
0046 value.code = code;
0047 first = std::lower_bound(first, last, value, comp);
0048 return first != last && !comp(value, *first) ? first : last;
0049 }
0050
0051 }
0052 #endif
0053
0054
0055 }}}
0056
0057 #endif