[CXX-869] mongocxx::result::insert_many::inserted_ids() should be const Created: 19/Mar/16  Updated: 17/Nov/17  Resolved: 27/Feb/17

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

Type: Improvement Priority: Major - P3
Reporter: Andrew Morrow (Inactive) Assignee: Samuel Rossi (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to CXX-1229 Fix incorrect constness in several pl... Backlog
related to CXX-1203 Audit methods for noexcept and constexpr Backlog

 Description   

mongocxx::result::insert_many::inserted_ids() does not modify the object, is thread-safe, and does not affect the results of future methods calls, so it should be const. This is similar to result::bulk_write::upserted_ids(), which is already const.

Original description:

Check all member functions for whether they can or should be made noexcept, or constexpr, or even just const.

Subsequent previous description:

Check all member functions for whether they can or should be made const.



 Comments   
Comment by Githook User [ 27/Feb/17 ]

Author:

{u'username': u'saghm', u'name': u'Saghm Rossi', u'email': u'saghmrossi@gmail.com'}

Message: CXX-869 mongocxx::result::insert_many::inserted_ids() should be const
Branch: master
https://github.com/mongodb/mongo-cxx-driver/commit/4ecd1b69138e24f94d5f58772bc05e7b4574bc68

Comment by Samuel Rossi (Inactive) [ 24/Feb/17 ]

As a result of the audit, we identified several places with incorrect constness. Most of these required API-breaking changes to fix, so they were put into CXX-1229 (which has fix version "future API change release".

Comment by David Golden [ 08/Sep/16 ]

In particular, methods that interact with the database but don't modify the object should be made const, including CRUD methods like insert_one and find.

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