[SERVER-37360] Make `StatusWith` accept types with implicit conversion semantics. Created: 27/Sep/18 Updated: 29/Oct/23 Resolved: 27/Sep/18 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 4.1.4 |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | ADAM Martin (Inactive) | Assignee: | ADAM Martin (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Backwards Compatibility: | Fully Compatible |
| Sprint: | Service Arch 2018-10-08 |
| Participants: |
| Description |
|
Use the enable-if for non-explicit constructors trick that `std::optional` uses to make `std::optional< std::unique_ptr< Base > >` accept `std::unique_ptr< Derived >` implicitly. This will permit things like this, among others: ``` ``` |
| Comments |
| Comment by Githook User [ 27/Sep/18 ] |
|
Author: {'name': 'ADAM David Alan Martin', 'email': 'adam.martin@10gen.com', 'username': 'adamlsd'}Message: This uses a variation of the technique used in `std::optional` to |