Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • A ArduinoJson
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 24
    • Issues 24
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Benoît Blanchon
  • ArduinoJson
  • Issues
  • #1411
Closed
Open
Issue created Oct 21, 2020 by Administrator@rootContributor

Problem with 6.17.0 with default value using overloaded "|" operator

Created by: labodj

Hi, since 6.17.0 this code is not working, it does not compile because it's complaining about the ambiguity of | overloaded operator.

#include <Arduino.h>
#include <ArduinoJson.h>


void setup()
{
}

void loop()
{
  const size_t capacity = JSON_OBJECT_SIZE(1) + 20;
  DynamicJsonDocument doc(capacity);
  const char *json = "{\"sensor\":\"gps\"}";
  deserializeJson(doc, json);
  const char *test = "test";
  const char *sensor = doc["sensor"] | test; // "gps"
}

Commenting lines 30-37 in /src/ArduinoJson/Variant/VariantOperators.hpp solve this problem, but can cause other unexpected ones.

Assignee
Assign to
Time tracking