@@ -41,18 +41,16 @@ std::string_view geometry_type(geometry_t const &geom)
4141{
4242 using namespace std ::literals::string_view_literals;
4343 return geom.visit (overloaded{
44- [& ](geom::nullgeom_t const & /* input*/ ) { return " NULL" sv; },
45- [& ](geom::point_t const & /* input*/ ) { return " POINT" sv; },
46- [& ](geom::linestring_t const & /* input*/ ) { return " LINESTRING" sv; },
47- [& ](geom::polygon_t const & /* input*/ ) { return " POLYGON" sv; },
48- [& ](geom::multipoint_t const & /* input*/ ) { return " MULTIPOINT" sv; },
49- [& ](geom::multilinestring_t const & /* input*/ ) {
44+ [](geom::nullgeom_t const & /* input*/ ) { return " NULL" sv; },
45+ [](geom::point_t const & /* input*/ ) { return " POINT" sv; },
46+ [](geom::linestring_t const & /* input*/ ) { return " LINESTRING" sv; },
47+ [](geom::polygon_t const & /* input*/ ) { return " POLYGON" sv; },
48+ [](geom::multipoint_t const & /* input*/ ) { return " MULTIPOINT" sv; },
49+ [](geom::multilinestring_t const & /* input*/ ) {
5050 return " MULTILINESTRING" sv;
5151 },
52- [&](geom::multipolygon_t const & /* input*/ ) {
53- return " MULTIPOLYGON" sv;
54- },
55- [&](geom::collection_t const & /* input*/ ) {
52+ [](geom::multipolygon_t const & /* input*/ ) { return " MULTIPOLYGON" sv; },
53+ [](geom::collection_t const & /* input*/ ) {
5654 return " GEOMETRYCOLLECTION" sv;
5755 }});
5856}
@@ -62,7 +60,7 @@ std::string_view geometry_type(geometry_t const &geom)
6260std::size_t num_geometries (geometry_t const &geom)
6361{
6462 return geom.visit (
65- [& ](auto const &input) { return input.num_geometries (); });
63+ [](auto const &input) { return input.num_geometries (); });
6664}
6765
6866/* ***************************************************************************/
@@ -353,14 +351,14 @@ geometry_t segmentize(geometry_t const &input, double max_segment_length)
353351double area (geometry_t const &geom)
354352{
355353 return std::abs (geom.visit (
356- overloaded{[& ](geom::nullgeom_t const & /* input*/ ) { return 0.0 ; },
357- [& ](geom::collection_t const &input) {
354+ overloaded{[](geom::nullgeom_t const & /* input*/ ) { return 0.0 ; },
355+ [](geom::collection_t const &input) {
358356 return std::accumulate (input.cbegin (), input.cend (), 0.0 ,
359357 [](double sum, auto const &geom) {
360358 return sum + area (geom);
361359 });
362360 },
363- [& ](auto const &input) {
361+ [](auto const &input) {
364362 return static_cast <double >(boost::geometry::area (input));
365363 }}));
366364}
@@ -390,37 +388,37 @@ double spherical_area(geometry_t const &geom)
390388 assert (geom.srid () == PROJ_LATLONG);
391389
392390 return std::abs (geom.visit (overloaded{
393- [& ](geom::nullgeom_t const & /* input*/ ) { return 0.0 ; },
394- [& ](geom::collection_t const &input) {
391+ [](geom::nullgeom_t const & /* input*/ ) { return 0.0 ; },
392+ [](geom::collection_t const &input) {
395393 return std::accumulate (input.cbegin (), input.cend (), 0.0 ,
396394 [](double sum, auto const &geom) {
397395 return sum + spherical_area (geom);
398396 });
399397 },
400- [& ](geom::polygon_t const &input) { return spherical_area (input); },
401- [& ](geom::multipolygon_t const &input) {
398+ [](geom::polygon_t const &input) { return spherical_area (input); },
399+ [](geom::multipolygon_t const &input) {
402400 return std::accumulate (input.cbegin (), input.cend (), 0.0 ,
403- [& ](double sum, auto const &geom) {
401+ [](double sum, auto const &geom) {
404402 return sum + spherical_area (geom);
405403 });
406404 },
407- [& ](auto const & /* input*/ ) { return 0.0 ; }}));
405+ [](auto const & /* input*/ ) { return 0.0 ; }}));
408406}
409407
410408/* ***************************************************************************/
411409
412410double length (geometry_t const &geom)
413411{
414412 return geom.visit (overloaded{
415- [& ](geom::nullgeom_t const & /* input*/ ) { return 0.0 ; },
416- [& ](geom::collection_t const &input) {
413+ [](geom::nullgeom_t const & /* input*/ ) { return 0.0 ; },
414+ [](geom::collection_t const &input) {
417415 double total = 0.0 ;
418416 for (auto const &item : input) {
419417 total += length (item);
420418 }
421419 return total;
422420 },
423- [& ](auto const &input) {
421+ [](auto const &input) {
424422 return static_cast <double >(boost::geometry::length (input));
425423 }});
426424}
0 commit comments