Edit

    for (const auto& [way_id, role] : members) {
        if (role != "outer" && !role.empty()) continue;

    for (const auto& [way_id, role] : members) {
        if (!include_all_roles && role != "outer" && !role.empty()) continue;