Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-54741

Add overload with consts to Expression walk for read-only usage

    • Type: Icon: Task Task
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Querying
    • Labels:

      The existing Expression walk always operates with visit methods that take 'Expression*' and allows replacement of the current Expression node. We should add an overload which accepts walkers with 'const Expression&' visit methods and disallows node replacement for read-only use cases.

      When we work on this ticket and modify the entrypoint to the walk function we should consider changing the mutable walk syntax from

      if (auto changed = walk(&walker, root.get()))
          root = changed.release();
      

      to something like

      root = walk(&walker, std::move(root));
      

            Assignee:
            hana.pearlman@mongodb.com Hana Pearlman
            Reporter:
            jacob.evans@mongodb.com Jacob Evans
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: