[CXX-1159] Make unwrapping conversion operators constant (PR #577) Created: 11/Dec/16  Updated: 20/Dec/16  Resolved: 20/Dec/16

Status: Closed
Project: C++ Driver
Component/s: API
Affects Version/s: None
Fix Version/s: 3.2.0-rc0

Type: New Feature Priority: Major - P3
Reporter: David Golden Assignee: J Rassi
Resolution: Done Votes: 0
Labels: pull-request
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 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 };



 Comments   
Comment by Githook User [ 20/Dec/16 ]

Author:

{u'username': u'kveziar', u'name': u'kveziar', u'email': u'kveziar@gmail.com'}

Message: CXX-1159 Add const to unwrapping conversion ops for bsoncxx::types::b_* classes
Branch: master
https://github.com/mongodb/mongo-cxx-driver/commit/23bdc57d348b5c25afd9fdb8476df63cf6e2e1b9

Generated at Wed Feb 07 22:01:36 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.