[SERVER-40356] Make ConstDataRange and friends constructable from any byte-like type or container of byte-like types Created: 27/Mar/19 Updated: 29/Oct/23 Resolved: 06/Apr/19 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 4.1.10 |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Jonathan Reams | Assignee: | Jonathan Reams |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Backwards Compatibility: | Fully Compatible |
| Sprint: | Security 2019-04-08 |
| Participants: |
| Description |
|
ConstDataRange and friends are very useful types for working with buffers, but we haven't defined a consistent "byte" type across the code base, so there are a lot of reinterpret_casts to coerce a ConstDataRange from various range-types of bytes. We should just make it so you can construct a ConstDataRange from any "byte-like" type, that is an integral type where the size of the type is one. Also, make them constructable from any stl container of byte-like types, such as std::vector<uint8_t> or std::array<char, size>. |
| Comments |
| Comment by Githook User [ 06/Apr/19 ] |
|
Author: {'name': 'Jonathan Reams', 'username': 'jbreams', 'email': 'jbreams@mongodb.com'}Message: |
| Comment by Githook User [ 06/Apr/19 ] |
|
Author: {'name': 'Jonathan Reams', 'username': 'jbreams', 'email': 'jbreams@mongodb.com'}Message: |