Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-40356

Make ConstDataRange and friends constructable from any byte-like type or container of byte-like types

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.1.10
    • Affects Version/s: None
    • Component/s: None
    • None
    • Fully Compatible
    • Security 2019-04-08

      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>.

            Assignee:
            jonathan.reams@mongodb.com Jonathan Reams
            Reporter:
            jonathan.reams@mongodb.com Jonathan Reams
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: