1 diff --git a/src/mapnik_image.cpp b/src/mapnik_image.cpp
2 index 9add692c9..488427b56 100644
3 --- a/src/mapnik_image.cpp
4 +++ b/src/mapnik_image.cpp
5 @@ -230,7 +230,7 @@ unsigned get_type(mapnik::image_any & im)
7 std::shared_ptr<image_any> open_from_file(std::string const& filename)
9 - boost::optional<std::string> type = type_from_filename(filename);
10 + auto type = type_from_filename(filename);
13 std::unique_ptr<image_reader> reader(get_image_reader(filename,*type));
14 diff --git a/src/mapnik_layer.cpp b/src/mapnik_layer.cpp
15 index 4fc7ea579..fbd277a81 100644
16 --- a/src/mapnik_layer.cpp
17 +++ b/src/mapnik_layer.cpp
18 @@ -95,7 +95,7 @@ struct layer_pickle_suite : boost::python::pickle_suite
20 std::vector<std::string> & (mapnik::layer::*_styles_)() = &mapnik::layer::styles;
22 -void set_maximum_extent(mapnik::layer & l, boost::optional<mapnik::box2d<double> > const& box)
23 +void set_maximum_extent(mapnik::layer & l, std::optional<mapnik::box2d<double> > const& box)
27 @@ -107,7 +107,7 @@ void set_maximum_extent(mapnik::layer & l, boost::optional<mapnik::box2d<double>
31 -void set_buffer_size(mapnik::layer & l, boost::optional<int> const& buffer_size)
32 +void set_buffer_size(mapnik::layer & l, std::optional<int> const& buffer_size)
36 @@ -121,7 +121,7 @@ void set_buffer_size(mapnik::layer & l, boost::optional<int> const& buffer_size)
38 PyObject * get_buffer_size(mapnik::layer & l)
40 - boost::optional<int> buffer_size = l.buffer_size();
41 + std::optional<int> buffer_size = l.buffer_size();
44 #if PY_VERSION_HEX >= 0x03000000
45 diff --git a/src/mapnik_map.cpp b/src/mapnik_map.cpp
46 index 3587e5d8a..cfa523b03 100644
47 --- a/src/mapnik_map.cpp
48 +++ b/src/mapnik_map.cpp
49 @@ -105,7 +105,7 @@ mapnik::featureset_ptr query_map_point(mapnik::Map const& m, int index, double x
50 return m.query_map_point(idx, x, y);
53 -void set_maximum_extent(mapnik::Map & m, boost::optional<mapnik::box2d<double> > const& box)
54 +void set_maximum_extent(mapnik::Map & m, std::optional<mapnik::box2d<double> > const& box)
58 diff --git a/src/python_optional.hpp b/src/python_optional.hpp
59 index d690b7c51..9d86c340e 100644
60 --- a/src/python_optional.hpp
61 +++ b/src/python_optional.hpp
63 #include <mapnik/util/noncopyable.hpp>
64 #pragma GCC diagnostic pop
66 -// boost::optional<T> to/from converter from John Wiegley
67 +// std::optional<T> to/from converter from John Wiegley
69 template <typename T, typename TfromPy>
70 struct object_from_python
71 @@ -54,7 +54,7 @@ struct python_optional : public mapnik::util::noncopyable
73 struct optional_to_python
75 - static PyObject * convert(const boost::optional<T>& value)
76 + static PyObject * convert(const std::optional<T>& value)
78 return (value ? boost::python::to_python_value<T>()(*value) :
79 boost::python::detail::none());
80 @@ -90,9 +90,9 @@ struct python_optional : public mapnik::util::noncopyable
83 if (data->convertible == source) // == None
84 - new (storage) boost::optional<T>(); // A Boost uninitialized value
85 + new (storage) std::optional<T>(); // A Boost uninitialized value
87 - new (storage) boost::optional<T>(*static_cast<T *>(data->convertible));
88 + new (storage) std::optional<T>(*static_cast<T *>(data->convertible));
90 data->convertible = storage;
92 @@ -100,18 +100,18 @@ struct python_optional : public mapnik::util::noncopyable
94 explicit python_optional()
96 - register_python_conversion<boost::optional<T>,
97 + register_python_conversion<std::optional<T>,
98 optional_to_python, optional_from_python>();
102 -// to/from boost::optional<bool>
103 +// to/from std::optional<bool>
105 struct python_optional<float> : public mapnik::util::noncopyable
107 struct optional_to_python
109 - static PyObject * convert(const boost::optional<float>& value)
110 + static PyObject * convert(const std::optional<float>& value)
112 return (value ? PyFloat_FromDouble(*value) :
113 boost::python::detail::none());
114 @@ -133,30 +133,30 @@ struct python_optional<float> : public mapnik::util::noncopyable
115 boost::python::converter::rvalue_from_python_stage1_data * data)
117 using namespace boost::python::converter;
118 - void * const storage = ((rvalue_from_python_storage<boost::optional<bool> > *)
119 + void * const storage = ((rvalue_from_python_storage<std::optional<bool> > *)
120 data)->storage.bytes;
121 if (source == Py_None) // == None
122 - new (storage) boost::optional<float>(); // A Boost uninitialized value
123 + new (storage) std::optional<float>(); // A Boost uninitialized value
125 - new (storage) boost::optional<float>(PyFloat_AsDouble(source));
126 + new (storage) std::optional<float>(PyFloat_AsDouble(source));
127 data->convertible = storage;
131 explicit python_optional()
133 - register_python_conversion<boost::optional<float>,
134 + register_python_conversion<std::optional<float>,
135 optional_to_python, optional_from_python>();
139 -// to/from boost::optional<float>
140 +// to/from std::optional<float>
142 struct python_optional<bool> : public mapnik::util::noncopyable
144 struct optional_to_python
146 - static PyObject * convert(const boost::optional<bool>& value)
147 + static PyObject * convert(const std::optional<bool>& value)
151 @@ -181,13 +181,13 @@ struct python_optional<bool> : public mapnik::util::noncopyable
152 boost::python::converter::rvalue_from_python_stage1_data * data)
154 using namespace boost::python::converter;
155 - void * const storage = ((rvalue_from_python_storage<boost::optional<bool> > *)
156 + void * const storage = ((rvalue_from_python_storage<std::optional<bool> > *)
157 data)->storage.bytes;
158 if (source == Py_None) // == None
159 - new (storage) boost::optional<bool>(); // A Boost uninitialized value
160 + new (storage) std::optional<bool>(); // A Boost uninitialized value
163 - new (storage) boost::optional<bool>(source == Py_True ? true : false);
164 + new (storage) std::optional<bool>(source == Py_True ? true : false);
166 data->convertible = storage;
168 @@ -195,7 +195,7 @@ struct python_optional<bool> : public mapnik::util::noncopyable
170 explicit python_optional()
172 - register_python_conversion<boost::optional<bool>,
173 + register_python_conversion<std::optional<bool>,
174 optional_to_python, optional_from_python>();