Uploaded image for project: 'C++ Driver'
  1. C++ Driver
  2. CXX-1159

Make unwrapping conversion operators constant (PR #577)

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.2.0-rc0
    • Component/s: API
    • Labels:
    • Sprint:
      Perl/CXX 2016-12-23

      Description

      Tracking ticket for PR #577

      We made conversion operators constant for bsoncxx types to make it possible to write like this:
       
      const bsoncxx::types::value& value{ ... }; // some value extracted from a document element
      bsoncxx::stdx::string_view str_view{ value.get_utf8() };
       
      Without const qualifier I have to use intermediate non-constant variable:
       
      bsoncxx::types::b_utf8 utf8{ value.get_utf8() };
      bsoncxx::stdx::string_view str_view{ utf8 };
      

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: