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

Support expression-first uassert

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Won't Fix
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Logging
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible

      Description

      The present form of uassert, with the check expression last, inverts the order needed by readers of the code, who need to see the expression being evaluated, first, before considering the error to be logged.

      It will need a different name for the macro, as the template magic to distinguish the variant argument orders would be too fragile for production use. In context, there would never be any confusion over which form was meant, and any mistakes would be caught by the compiler, so the names need not be very different. I suggest ussert would serve, but any name not longer than "uassert" would do as well.

        Attachments

          Activity

            People

            Assignee:
            backlog-server-platform DO NOT USE - Backlog - Platform Team
            Reporter:
            nathan.myers Nathan Myers
            Participants:
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: