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

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

    XMLWordPrintable

    Details

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

      Description

      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));
      

        Attachments

          Activity

            People

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

              Dates

              Created:
              Updated:
              Resolved: