[SERVER-46503] inline namespace mongo::literals for UDLs Created: 28/Feb/20 Updated: 29/Oct/23 Resolved: 25/Mar/20 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Internal Code |
| Affects Version/s: | None |
| Fix Version/s: | 4.7.0 |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Billy Donahue | Assignee: | Billy Donahue |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||
| Sprint: | Dev Tools 2020-03-09, Service Arch 2020-04-06 | ||||||||
| Participants: | |||||||||
| Description |
|
We have seen in logv2 cleanup that there are places that are not in the mongo namespace lexical scope, but need our UDLs like `::mongo::operator"" _attr`. We need to add a using directive to get the `_attr` UDL. We would NOT want to bring in all of ::mongo though. We should do what std does, and make a nested inline namespace: ::mongo::literals to hold our UDLs so you can get them without bringing in other ::mongo names. We could go further and make namespaces further nested inside literals like std::literals::string_literals and std::literals::chrono_literals, but I don't think we need to go that far. mongo only has a few UDLs. This will help us introduce logv2 into arbitrary mongo code. |
| Comments |
| Comment by Githook User [ 25/Mar/20 ] |
|
Author: {'email': 'billy.donahue@mongodb.com', 'name': 'Billy Donahue', 'username': 'BillyDonahue'}Message: |
| Comment by Billy Donahue [ 25/Mar/20 ] |