@@ -83,38 +83,38 @@ struct binary_operation_obj
83
83
using result_type = Result;
84
84
85
85
template <typename V1, typename V2> BOOST_FORCEINLINE
86
- result_type operator ()(const std::pair<const V1*,const V2*>& p) const {
86
+ auto operator ()(const std::pair<const V1*,const V2*>& p) const -> result_type {
87
87
return apply (*p.first , *p.second , typename views_are_compatible<V1,V2>::type ());
88
88
}
89
89
90
90
template <typename V1, typename V2> BOOST_FORCEINLINE
91
- result_type operator ()(const V1& v1, const V2& v2) const {
91
+ auto operator ()(const V1& v1, const V2& v2) const -> result_type {
92
92
return apply (v1, v2, typename views_are_compatible<V1,V2>::type ());
93
93
}
94
94
95
- result_type operator ()(const error_t &) const { throw std::bad_cast (); }
95
+ auto operator ()(const error_t &) const -> result_type { throw std::bad_cast (); }
96
96
private:
97
97
98
98
// dispatch from apply overload to a function with distinct name
99
99
template <typename V1, typename V2>
100
100
BOOST_FORCEINLINE
101
- result_type apply (V1 const & v1, V2 const & v2, std::false_type) const
101
+ auto apply (V1 const & v1, V2 const & v2, std::false_type) const -> result_type
102
102
{
103
103
return ((const Derived*)this )->apply_incompatible (v1, v2);
104
104
}
105
105
106
106
// dispatch from apply overload to a function with distinct name
107
107
template <typename V1, typename V2>
108
108
BOOST_FORCEINLINE
109
- result_type apply (V1 const & v1, V2 const & v2, std::true_type) const
109
+ auto apply (V1 const & v1, V2 const & v2, std::true_type) const -> result_type
110
110
{
111
111
return ((const Derived*)this )->apply_compatible (v1, v2);
112
112
}
113
113
114
114
// function with distinct name - it can be overloaded by subclasses
115
115
template <typename V1, typename V2>
116
116
BOOST_FORCEINLINE
117
- result_type apply_incompatible (V1 const & /* v1*/ , V2 const & /* v2*/ ) const
117
+ auto apply_incompatible (V1 const & /* v1*/ , V2 const & /* v2*/ ) const -> result_type
118
118
{
119
119
throw std::bad_cast ();
120
120
}
@@ -149,9 +149,10 @@ auto copy(
149
149
// / \ingroup STLOptimizations
150
150
// / \brief Copy when both src and dst are interleaved and of the same type can be just memmove
151
151
template <typename T, typename CS>
152
- BOOST_FORCEINLINE boost::gil::pixel<T,CS>*
153
- copy (const boost::gil::pixel<T,CS>* first, const boost::gil::pixel<T,CS>* last,
154
- boost::gil::pixel<T,CS>* dst) {
152
+ BOOST_FORCEINLINE
153
+ auto copy (const boost::gil::pixel<T,CS>* first, const boost::gil::pixel<T,CS>* last,
154
+ boost::gil::pixel<T,CS>* dst) -> boost::gil::pixel<T,CS>*
155
+ {
155
156
return (boost::gil::pixel<T,CS>*)std::copy ((unsigned char *)first,(unsigned char *)last, (unsigned char *)dst);
156
157
}
157
158
} // namespace std
@@ -168,7 +169,8 @@ namespace std {
168
169
// / \ingroup STLOptimizations
169
170
// / \brief Copy when both src and dst are planar pointers is copy for each channel
170
171
template <typename CS, typename IC1, typename IC2> BOOST_FORCEINLINE
171
- boost::gil::planar_pixel_iterator<IC2,CS> copy (boost::gil::planar_pixel_iterator<IC1,CS> first, boost::gil::planar_pixel_iterator<IC1,CS> last, boost::gil::planar_pixel_iterator<IC2,CS> dst) {
172
+ auto copy (boost::gil::planar_pixel_iterator<IC1,CS> first, boost::gil::planar_pixel_iterator<IC1,CS> last, boost::gil::planar_pixel_iterator<IC2,CS> dst) -> boost::gil::planar_pixel_iterator<IC2,CS>
173
+ {
172
174
boost::gil::gil_function_requires<boost::gil::ChannelsCompatibleConcept<typename std::iterator_traits<IC1>::value_type,typename std::iterator_traits<IC2>::value_type>>();
173
175
static_for_each (first,last,dst,boost::gil::detail::copy_fn<IC1,IC2>());
174
176
return dst+(last-first);
@@ -244,7 +246,7 @@ struct copier_n<iterator_from_2d<IL>,iterator_from_2d<OL>> {
244
246
};
245
247
246
248
template <typename SrcIterator, typename DstIterator>
247
- BOOST_FORCEINLINE DstIterator copy_with_2d_iterators (SrcIterator first, SrcIterator last, DstIterator dst) {
249
+ BOOST_FORCEINLINE auto copy_with_2d_iterators (SrcIterator first, SrcIterator last, DstIterator dst) -> DstIterator {
248
250
using src_x_iterator = typename SrcIterator::x_iterator;
249
251
using dst_x_iterator = typename DstIterator::x_iterator;
250
252
@@ -270,9 +272,11 @@ namespace std {
270
272
// / \ingroup STLOptimizations
271
273
// / \brief std::copy(I1,I1,I2) with I1 and I2 being a iterator_from_2d
272
274
template <typename IL, typename OL>
273
- BOOST_FORCEINLINE boost::gil::iterator_from_2d<OL> copy1 (boost::gil::iterator_from_2d<IL> first, boost::gil::iterator_from_2d<IL> last, boost::gil::iterator_from_2d<OL> dst) {
275
+ BOOST_FORCEINLINE auto copy1 (boost::gil::iterator_from_2d<IL> first, boost::gil::iterator_from_2d<IL> last, boost::gil::iterator_from_2d<OL> dst) -> boost::gil::iterator_from_2d<OL>
276
+ {
274
277
return boost::gil::detail::copy_with_2d_iterators (first,last,dst);
275
278
}
279
+
276
280
} // namespace std
277
281
278
282
namespace boost { namespace gil {
@@ -307,13 +311,13 @@ class copy_and_convert_pixels_fn : public binary_operation_obj<copy_and_convert_
307
311
copy_and_convert_pixels_fn (CC cc_in) : _cc(cc_in) {}
308
312
// when the two color spaces are incompatible, a color conversion is performed
309
313
template <typename V1, typename V2> BOOST_FORCEINLINE
310
- result_type apply_incompatible (const V1& src, const V2& dst) const {
314
+ auto apply_incompatible (const V1& src, const V2& dst) const -> result_type {
311
315
copy_pixels (color_converted_view<typename V2::value_type>(src,_cc),dst);
312
316
}
313
317
314
318
// If the two color spaces are compatible, copy_and_convert is just copy
315
319
template <typename V1, typename V2> BOOST_FORCEINLINE
316
- result_type apply_compatible (const V1& src, const V2& dst) const {
320
+ auto apply_compatible (const V1& src, const V2& dst) const -> result_type {
317
321
copy_pixels (src,dst);
318
322
}
319
323
};
0 commit comments