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

Support expression-first uassert

    • Type: Icon: Improvement Improvement
    • Resolution: Won't Fix
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Logging
    • None
    • Fully Compatible

      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.

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

              Created:
              Updated:
              Resolved: