[SERVER-17827] create macro for reference functions to be used for disabling methods on a temporary Created: 31/Mar/15 Updated: 23/May/16 Resolved: 23/May/16 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Internal Code |
| Affects Version/s: | 3.1.0 |
| Fix Version/s: | None |
| Type: | Task | Priority: | Major - P3 |
| Reporter: | Matt Dannenberg | Assignee: | DO NOT USE - Backlog - Platform Team |
| Resolution: | Done | Votes: | 2 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Attachments: |
|
| Backwards Compatibility: | Fully Compatible |
| Participants: |
| Description |
|
NamespaceString::db() and NamespaceString::coll() can be called on a temporary NamespaceString, which will result in a StringData which points to invalid memory. One way to prevent this is by explicitly deleting the rvalue version of the function (see attached example.diff). The trouble is MSVC13 does not support reference functions. So we need to build a macro. |
| Comments |
| Comment by Mira Carey [ 23/May/16 ] |
|
Since we've upgraded to 2015, we can delete rvalue versions of functions without needing a macro |
| Comment by Andrew Morrow (Inactive) [ 07/Apr/15 ] |
|
VS2015 was announced for May, so I think we should wait rather than adding more macros. |
| Comment by Eric Milkie [ 31/Mar/15 ] |
|
If we wait for VS2015, we may avoid needing to create the macro. |