[SERVER-31673] Support expression-first uassert Created: 22/Oct/17  Updated: 03/Nov/17  Resolved: 03/Nov/17

Status: Closed
Project: Core Server
Component/s: Logging
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Nathan Myers Assignee: DO NOT USE - Backlog - Platform Team
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Participants:

 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.


Generated at Thu Feb 08 04:27:49 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.