re-use lamdas definitions and aviod duplicate symbols when building with vs2017

This commit is contained in:
artemp 2017-07-06 10:59:42 +02:00
parent 53249053e4
commit 4c9322bc0d
3 changed files with 16 additions and 26 deletions

View file

@ -164,15 +164,6 @@ struct geometry_type_ : x3::symbols<mapnik::geometry::geometry_types>
}
} geometry_type_symbols;
auto assign_name = [](auto const& ctx)
{
std::get<0>(_val(ctx)) = std::move(_attr(ctx));
};
auto assign_value = [](auto const& ctx)
{
std::get<1>(_val(ctx)) = std::move(_attr(ctx));
};
auto const assign_geometry_type = [] (auto const& ctx)
{
std::get<0>(_val(ctx)) = _attr(ctx);
@ -263,7 +254,7 @@ auto const geometry_tuple_def = (geometry_type[assign_geometry_type]
(omit[geojson_string] > lit(':') > omit[value])) % lit(',');
auto const property_def = geojson_string[assign_name] > lit(':') > value[assign_value];
auto const property_def = geojson_string[assign_key] > lit(':') > value[assign_value];
auto const properties_def = property[assign_property] % lit(',');

View file

@ -43,6 +43,21 @@ BOOST_SPIRIT_DECLARE(generic_json_grammar_type);
BOOST_SPIRIT_DECLARE(generic_json_key_value_type);
}
auto assign = [](auto const& ctx)
{
_val(ctx) = _attr(ctx);
};
auto assign_key = [](auto const& ctx)
{
std::get<0>(_val(ctx)) = _attr(ctx);
};
auto assign_value = [](auto const& ctx)
{
std::get<1>(_val(ctx)) = std::move(_attr(ctx));
};
grammar::generic_json_grammar_type const& generic_json_grammar();
grammar::generic_json_key_value_type const& generic_json_key_value();

View file

@ -46,22 +46,6 @@ auto make_false = [] (auto const& ctx)
_val(ctx) = false;
};
auto assign = [](auto const& ctx)
{
_val(ctx) = _attr(ctx);
};
auto assign_key = [](auto const& ctx)
{
std::get<0>(_val(ctx)) = _attr(ctx);
};
auto assign_value = [](auto const& ctx)
{
std::get<1>(_val(ctx)) = _attr(ctx);
};
using x3::lit;
using x3::string;
// exported rules