]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/boost/geometry/srs/projections/code.hpp
update sources to ceph Nautilus 14.2.1
[ceph.git] / ceph / src / boost / boost / geometry / srs / projections / code.hpp
1 // Boost.Geometry
2
3 // Copyright (c) 2017, Oracle and/or its affiliates.
4 // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
5
6 // Use, modification and distribution is subject to the Boost Software License,
7 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
8 // http://www.boost.org/LICENSE_1_0.txt)
9
10 #ifndef BOOST_GEOMETRY_PROJECTIONS_CODE_HPP
11 #define BOOST_GEOMETRY_PROJECTIONS_CODE_HPP
12
13
14 #include <algorithm>
15 #include <string>
16
17
18 namespace boost { namespace geometry { namespace projections
19 {
20
21
22 #ifndef DOXYGEN_NO_DETAIL
23 namespace detail
24 {
25
26 struct code_element
27 {
28 int code;
29 std::string proj4_str;
30 };
31
32 struct code_element_less
33 {
34 inline bool operator()(code_element const& l, code_element const& r) const
35 {
36 return l.code < r.code;
37 }
38 };
39
40 template<typename RandIt>
41 inline RandIt binary_find_code_element(RandIt first, RandIt last, int code)
42 {
43 code_element_less comp;
44 code_element value;
45 value.code = code;
46 first = std::lower_bound(first, last, value, code_element_less());
47 return first != last && !comp(value, *first) ? first : last;
48 }
49
50 }
51 #endif // DOXYGEN_NO_DETAIL
52
53
54 }}} // namespace boost::geometry::projections
55
56 #endif