[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: SERVER-40356 Make ConstDataRange constructable from any byte-like type
Branch: master
https://github.com/mongodb/mongo/commit/83383eb160f904c699b399ac59ccbbf103ad6102

Comment by Githook User [ 06/Apr/19 ]

Author:

{'name': 'Jonathan Reams', 'username': 'jbreams', 'email': 'jbreams@mongodb.com'}

Message: SERVER-40356 Construct ConstDataRange from any byte-like type
Branch: master
https://github.com/10gen/mongo-enterprise-modules/commit/113aff562eb79a20913ba6f32acd4f52f671a48c

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