From 664d3508deefdbdd70ce9c49b501f57f906bb23b Mon Sep 17 00:00:00 2001 From: Artem Pavlenko Date: Wed, 18 Apr 2018 12:52:29 +0200 Subject: [PATCH] remove reference_wrapper usage when injecting attributes into grammar ( >= boost_1_67) [skip-ci] --- .../mapnik/expression_grammar_x3_config.hpp | 2 +- include/mapnik/expression_grammar_x3_def.hpp | 6 ++--- .../json/extract_bounding_boxes_x3_config.hpp | 20 ++++++++-------- include/mapnik/json/json_grammar_config.hpp | 12 +++++----- include/mapnik/svg/svg_grammar_config_x3.hpp | 4 ++-- .../mapnik/svg/svg_path_grammar_x3_def.hpp | 24 +++++++++---------- .../svg/svg_transform_grammar_x3_def.hpp | 12 +++++----- src/expression.cpp | 2 +- src/json/extract_bounding_boxes_x3.cpp | 6 ++--- src/json/parse_feature.cpp | 4 ++-- src/parse_transform.cpp | 2 +- src/svg/svg_path_parser.cpp | 4 ++-- src/svg/svg_points_parser.cpp | 4 ++-- src/svg/svg_transform_parser.cpp | 2 +- .../mapnik-index/process_geojson_file_x3.cpp | 2 +- 15 files changed, 53 insertions(+), 53 deletions(-) diff --git a/include/mapnik/expression_grammar_x3_config.hpp b/include/mapnik/expression_grammar_x3_config.hpp index 8aba3d75b..3de3e27c4 100644 --- a/include/mapnik/expression_grammar_x3_config.hpp +++ b/include/mapnik/expression_grammar_x3_config.hpp @@ -35,7 +35,7 @@ using phrase_context_type = x3::phrase_parse_context::typ // define combined context using context_type = x3::context, + mapnik::transcoder const, phrase_context_type>; }} diff --git a/include/mapnik/expression_grammar_x3_def.hpp b/include/mapnik/expression_grammar_x3_def.hpp index dd7d40eba..5f234c1f6 100644 --- a/include/mapnik/expression_grammar_x3_def.hpp +++ b/include/mapnik/expression_grammar_x3_def.hpp @@ -130,7 +130,7 @@ namespace mapnik { namespace grammar { auto do_unicode = [] (auto const& ctx) { - auto & tr = x3::get(ctx).get(); + auto const& tr = x3::get(ctx); _val(ctx) = std::move(tr.transcode(_attr(ctx).c_str())); }; @@ -188,13 +188,13 @@ namespace mapnik { namespace grammar { // regex auto do_regex_match = [] (auto const& ctx) { - auto const& tr = x3::get(ctx).get(); + auto const& tr = x3::get(ctx); _val(ctx) = std::move(mapnik::regex_match_node(tr, std::move(_val(ctx)) , std::move(_attr(ctx)))); }; auto do_regex_replace = [] (auto const& ctx) { - auto const& tr = x3::get(ctx).get(); + auto const& tr = x3::get(ctx); auto const& pair = _attr(ctx); auto const& pattern = std::get<0>(pair); auto const& format = std::get<1>(pair); diff --git a/include/mapnik/json/extract_bounding_boxes_x3_config.hpp b/include/mapnik/json/extract_bounding_boxes_x3_config.hpp index 54a2b17a4..eb7eb4193 100644 --- a/include/mapnik/json/extract_bounding_boxes_x3_config.hpp +++ b/include/mapnik/json/extract_bounding_boxes_x3_config.hpp @@ -85,26 +85,26 @@ using space_type = x3::standard::space_type; using phrase_parse_context_type = x3::phrase_parse_context::type; using extract_bounding_boxes_context_type = - x3::context, - x3::context, + x3::context>; using extract_bounding_boxes_reverse_context_type = - x3::context, - x3::context, - x3::context, + x3::context>>; using extract_bounding_boxes_context_type_f = - x3::context, - x3::context, + x3::context>; using extract_bounding_boxes_reverse_context_type_f = - x3::context, - x3::context, - x3::context, + x3::context>>; }}} diff --git a/include/mapnik/json/json_grammar_config.hpp b/include/mapnik/json/json_grammar_config.hpp index e17b4773d..92422031e 100644 --- a/include/mapnik/json/json_grammar_config.hpp +++ b/include/mapnik/json/json_grammar_config.hpp @@ -92,20 +92,20 @@ using iterator_type = char const*; using phrase_parse_context_type = x3::phrase_parse_context::type; using context_type = x3::context, + keys_map, phrase_parse_context_type>; using feature_context_type = x3::context, + mapnik::transcoder const, x3::context, - phrase_parse_context_type>>; + mapnik::feature_impl, + phrase_parse_context_type>>; // our spirit x3 grammars needs this one with changed order of feature_impl and transcoder (??) using feature_context_const_type = x3::context, + mapnik::feature_impl, x3::context, + mapnik::transcoder const, phrase_parse_context_type>>; // helper macro diff --git a/include/mapnik/svg/svg_grammar_config_x3.hpp b/include/mapnik/svg/svg_grammar_config_x3.hpp index 63cbf79e1..c60595572 100644 --- a/include/mapnik/svg/svg_grammar_config_x3.hpp +++ b/include/mapnik/svg/svg_grammar_config_x3.hpp @@ -40,8 +40,8 @@ using space_type = x3::standard::space_type; using iterator_type = char const*; using phrase_parse_context_type = x3::phrase_parse_context::type; -using svg_parse_context_type = x3::context, - x3::context, +using svg_parse_context_type = x3::context>; inline double deg2rad(double deg) {return (M_PI * deg) / 180.0;} diff --git a/include/mapnik/svg/svg_path_grammar_x3_def.hpp b/include/mapnik/svg/svg_path_grammar_x3_def.hpp index 125276e54..dab035bdc 100644 --- a/include/mapnik/svg/svg_path_grammar_x3_def.hpp +++ b/include/mapnik/svg/svg_path_grammar_x3_def.hpp @@ -45,22 +45,22 @@ using coord_type = std::tuple; auto const move_to = [] (auto const& ctx) { - x3::get(ctx).get().move_to(std::get<0>(_attr(ctx)), std::get<1>(_attr(ctx)), x3::get(ctx)); + x3::get(ctx).move_to(std::get<0>(_attr(ctx)), std::get<1>(_attr(ctx)), x3::get(ctx)); }; auto const line_to = [] (auto const & ctx) { - x3::get(ctx).get().line_to(std::get<0>(_attr(ctx)), std::get<1>(_attr(ctx)), x3::get(ctx)); + x3::get(ctx).line_to(std::get<0>(_attr(ctx)), std::get<1>(_attr(ctx)), x3::get(ctx)); }; auto const hline_to = [] (auto const& ctx) { - x3::get(ctx).get().hline_to(_attr(ctx), x3::get(ctx)); + x3::get(ctx).hline_to(_attr(ctx), x3::get(ctx)); }; auto const vline_to = [] (auto const& ctx) { - x3::get(ctx).get().vline_to(_attr(ctx), x3::get(ctx)); + x3::get(ctx).vline_to(_attr(ctx), x3::get(ctx)); }; auto const curve4 = [] (auto const& ctx) @@ -69,7 +69,7 @@ auto const curve4 = [] (auto const& ctx) auto const& p0 = boost::fusion::at_c<0>(attr); auto const& p1 = boost::fusion::at_c<1>(attr); auto const& p2 = boost::fusion::at_c<2>(attr); - x3::get(ctx).get().curve4(std::get<0>(p0),std::get<1>(p0), + x3::get(ctx).curve4(std::get<0>(p0),std::get<1>(p0), std::get<0>(p1),std::get<1>(p1), std::get<0>(p2),std::get<1>(p2), x3::get(ctx)); @@ -80,7 +80,7 @@ auto const curve4_smooth = [] (auto const& ctx) auto const& attr = _attr(ctx); auto const& p0 = boost::fusion::at_c<0>(attr); auto const& p1 = boost::fusion::at_c<1>(attr); - x3::get(ctx).get().curve4(std::get<0>(p0),std::get<1>(p0), + x3::get(ctx).curve4(std::get<0>(p0),std::get<1>(p0), std::get<0>(p1),std::get<1>(p1), x3::get(ctx)); }; @@ -90,7 +90,7 @@ auto const curve3 = [] (auto const& ctx) auto const& attr = _attr(ctx); auto const& p0 = boost::fusion::at_c<0>(attr); auto const& p1 = boost::fusion::at_c<1>(attr); - x3::get(ctx).get().curve3(std::get<0>(p0),std::get<1>(p0), + x3::get(ctx).curve3(std::get<0>(p0),std::get<1>(p0), std::get<0>(p1),std::get<1>(p1), x3::get(ctx)); }; @@ -98,7 +98,7 @@ auto const curve3 = [] (auto const& ctx) auto const curve3_smooth = [] (auto const& ctx) { auto const& attr = _attr(ctx); - x3::get(ctx).get().curve3(std::get<0>(attr),std::get<1>(attr), + x3::get(ctx).curve3(std::get<0>(attr),std::get<1>(attr), x3::get(ctx)); }; @@ -111,7 +111,7 @@ auto const arc_to = [] (auto & ctx) int large_arc_flag = boost::fusion::at_c<2>(attr); int sweep_flag = boost::fusion::at_c<3>(attr); auto const& v = boost::fusion::at_c<4>(attr); - x3::get(ctx).get().arc_to(std::get<0>(p),std::get<1>(p), + x3::get(ctx).arc_to(std::get<0>(p),std::get<1>(p), deg2rad(angle), large_arc_flag, sweep_flag, std::get<0>(v),std::get<1>(v), x3::get(ctx)); @@ -119,17 +119,17 @@ auto const arc_to = [] (auto & ctx) auto const close_path = [] (auto const& ctx) { - x3::get(ctx).get().close_subpath(); + x3::get(ctx).close_subpath(); }; auto const relative = [] (auto const& ctx) { - x3::get(ctx).get() = true; + x3::get(ctx) = true; }; auto const absolute = [] (auto const& ctx) { - x3::get(ctx).get() = false; + x3::get(ctx) = false; }; // exported rules diff --git a/include/mapnik/svg/svg_transform_grammar_x3_def.hpp b/include/mapnik/svg/svg_transform_grammar_x3_def.hpp index dcf2b274e..b3b7ebe47 100644 --- a/include/mapnik/svg/svg_transform_grammar_x3_def.hpp +++ b/include/mapnik/svg/svg_transform_grammar_x3_def.hpp @@ -46,7 +46,7 @@ using x3::no_case; auto const matrix_action = [] (auto const& ctx) { - auto & tr = x3::get(ctx).get(); + auto & tr = x3::get(ctx); auto const& attr = _attr(ctx); auto a = boost::fusion::at_c<0>(attr); auto b = boost::fusion::at_c<1>(attr); @@ -59,7 +59,7 @@ auto const matrix_action = [] (auto const& ctx) auto const rotate_action = [] (auto const& ctx) { - auto & tr = x3::get(ctx).get(); + auto & tr = x3::get(ctx); auto const& attr = _attr(ctx); auto a = boost::fusion::at_c<0>(attr); auto cx = boost::fusion::at_c<1>(attr) ? *boost::fusion::at_c<1>(attr) : 0.0; @@ -79,7 +79,7 @@ auto const rotate_action = [] (auto const& ctx) auto const translate_action = [] (auto const& ctx) { - auto & tr = x3::get(ctx).get(); + auto & tr = x3::get(ctx); auto const& attr = _attr(ctx); auto tx = boost::fusion::at_c<0>(attr); auto ty = boost::fusion::at_c<1>(attr); @@ -89,7 +89,7 @@ auto const translate_action = [] (auto const& ctx) auto const scale_action = [] (auto const& ctx) { - auto & tr = x3::get(ctx).get(); + auto & tr = x3::get(ctx); auto const& attr = _attr(ctx); auto sx = boost::fusion::at_c<0>(attr); auto sy = boost::fusion::at_c<1>(attr); @@ -99,14 +99,14 @@ auto const scale_action = [] (auto const& ctx) auto const skewX_action = [] (auto const& ctx) { - auto & tr = x3::get(ctx).get(); + auto & tr = x3::get(ctx); auto skew_x = _attr(ctx); tr = agg::trans_affine_skewing(deg2rad(skew_x), 0.0) * tr; }; auto const skewY_action = [] (auto const& ctx) { - auto & tr = x3::get(ctx).get(); + auto & tr = x3::get(ctx); auto skew_y= _attr(ctx); tr = agg::trans_affine_skewing(0.0, deg2rad(skew_y)) * tr; }; diff --git a/src/expression.cpp b/src/expression.cpp index b1633b2aa..ad87eb5ec 100644 --- a/src/expression.cpp +++ b/src/expression.cpp @@ -35,7 +35,7 @@ expression_ptr parse_expression(std::string const& str) auto node = std::make_shared(); using boost::spirit::x3::ascii::space; mapnik::transcoder const tr("utf8"); - auto parser = boost::spirit::x3::with(std::ref(tr)) + auto parser = boost::spirit::x3::with(tr) [ mapnik::expression_grammar() ]; diff --git a/src/json/extract_bounding_boxes_x3.cpp b/src/json/extract_bounding_boxes_x3.cpp index fe10ee21e..af9367ebe 100644 --- a/src/json/extract_bounding_boxes_x3.cpp +++ b/src/json/extract_bounding_boxes_x3.cpp @@ -185,9 +185,9 @@ void extract_bounding_boxes(Iterator& start, Iterator const& end, Boxes & boxes) extract_positions callback(start, boxes); auto keys = mapnik::json::get_keys(); std::size_t bracket_counter = 0; - auto feature_collection_impl = x3::with(std::ref(bracket_counter)) - [x3::with(std::ref(callback)) - [x3::with(std::ref(keys)) + auto feature_collection_impl = x3::with(bracket_counter) + [x3::with(callback) + [x3::with(keys) [mapnik::json::grammar::feature_collection] ]]; diff --git a/src/json/parse_feature.cpp b/src/json/parse_feature.cpp index c5ac0c491..6530377b4 100644 --- a/src/json/parse_feature.cpp +++ b/src/json/parse_feature.cpp @@ -31,8 +31,8 @@ void parse_feature(Iterator start, Iterator end, feature_impl& feature, mapnik:: { namespace x3 = boost::spirit::x3; using space_type = mapnik::json::grammar::space_type; - auto grammar = x3::with(std::ref(tr)) - [x3::with(std::ref(feature)) + auto grammar = x3::with(tr) + [x3::with(feature) [ mapnik::json::feature_grammar() ]]; if (!x3::phrase_parse(start, end, grammar, space_type())) { diff --git a/src/parse_transform.cpp b/src/parse_transform.cpp index b4affae3b..3d2e5e0e4 100644 --- a/src/parse_transform.cpp +++ b/src/parse_transform.cpp @@ -37,7 +37,7 @@ transform_list_ptr parse_transform(std::string const& str, std::string const& en std::string::const_iterator itr = str.begin(); std::string::const_iterator end = str.end(); mapnik::transcoder const tr(encoding); - auto const parser = boost::spirit::x3::with(std::ref(tr)) + auto const parser = boost::spirit::x3::with(tr) [ mapnik::transform_expression_grammar() ]; diff --git a/src/svg/svg_path_parser.cpp b/src/svg/svg_path_parser.cpp index e429d6358..390b80da6 100644 --- a/src/svg/svg_path_parser.cpp +++ b/src/svg/svg_path_parser.cpp @@ -40,8 +40,8 @@ bool parse_path(const char* wkt, PathType& p) iterator_type last = wkt + std::strlen(wkt); bool relative = false; using space_type = mapnik::svg::grammar::space_type; - auto const grammar = x3::with(std::ref(p)) - [ x3::with(std::ref(relative)) + auto const grammar = x3::with(p) + [ x3::with(relative) [mapnik::svg::svg_path_grammar()]]; try diff --git a/src/svg/svg_points_parser.cpp b/src/svg/svg_points_parser.cpp index ddbb7aa81..2fd68734c 100644 --- a/src/svg/svg_points_parser.cpp +++ b/src/svg/svg_points_parser.cpp @@ -40,8 +40,8 @@ bool parse_points(const char* wkt, PathType& p) iterator_type last = wkt + std::strlen(wkt); bool relative = false; - auto const grammar = x3::with(std::ref(p)) - [ x3::with(std::ref(relative)) + auto const grammar = x3::with(p) + [ x3::with(relative) [mapnik::svg::svg_points_grammar()]]; try diff --git a/src/svg/svg_transform_parser.cpp b/src/svg/svg_transform_parser.cpp index e2c8e4636..e1ecf5639 100644 --- a/src/svg/svg_transform_parser.cpp +++ b/src/svg/svg_transform_parser.cpp @@ -37,7 +37,7 @@ bool parse_svg_transform(const char* wkt, Transform& tr) iterator_type first = wkt; iterator_type last = wkt + std::strlen(wkt); using space_type = mapnik::svg::grammar::space_type; - auto const grammar = x3::with(std::ref(tr)) + auto const grammar = x3::with(tr) [mapnik::svg::svg_transform_grammar()]; try diff --git a/utils/mapnik-index/process_geojson_file_x3.cpp b/utils/mapnik-index/process_geojson_file_x3.cpp index 1f4487ce3..62f5ccdea 100644 --- a/utils/mapnik-index/process_geojson_file_x3.cpp +++ b/utils/mapnik-index/process_geojson_file_x3.cpp @@ -285,7 +285,7 @@ std::pair process_geojson_file_x3(T & b using namespace boost::spirit; using space_type = mapnik::json::grammar::space_type; auto keys = mapnik::json::get_keys(); - auto feature_grammar = x3::with(std::ref(keys)) + auto feature_grammar = x3::with(keys) [ geojson_value ]; for (auto const& item : boxes) {