JSON - wrap lamda functions into anonymous namespace to fix linking on Windows with VS2017.

This commit is contained in:
artemp 2017-07-06 16:09:38 +02:00
parent b632633373
commit 3ae71eea0f
2 changed files with 10 additions and 3 deletions

View file

@ -164,6 +164,8 @@ struct geometry_type_ : x3::symbols<mapnik::geometry::geometry_types>
}
} geometry_type_symbols;
namespace {
auto assign_name = [](auto const& ctx)
{
std::get<0>(_val(ctx)) = std::move(_attr(ctx));
@ -173,6 +175,8 @@ auto assign_value = [](auto const& ctx)
std::get<1>(_val(ctx)) = std::move(_attr(ctx));
};
} // VS2017
auto const assign_geometry_type = [] (auto const& ctx)
{
std::get<0>(_val(ctx)) = _attr(ctx);

View file

@ -31,6 +31,8 @@ namespace mapnik { namespace json { namespace grammar {
namespace x3 = boost::spirit::x3;
namespace {
auto make_null = [] (auto const& ctx)
{
_val(ctx) = mapnik::value_null{};
@ -48,19 +50,20 @@ auto make_false = [] (auto const& ctx)
auto assign = [](auto const& ctx)
{
_val(ctx) = _attr(ctx);
_val(ctx) = std::move(_attr(ctx));
};
auto assign_key = [](auto const& ctx)
{
std::get<0>(_val(ctx)) = _attr(ctx);
std::get<0>(_val(ctx)) = std::move(_attr(ctx));
};
auto assign_value = [](auto const& ctx)
{
std::get<1>(_val(ctx)) = _attr(ctx);
std::get<1>(_val(ctx)) = std::move(_attr(ctx));
};
} // VS2017
using x3::lit;
using x3::string;