[CXX-1068] Make bsoncxx iterators always const_iterators Created: 04/Oct/16  Updated: 15/Nov/16  Resolved: 03/Nov/16

Status: Closed
Project: C++ Driver
Component/s: API
Affects Version/s: None
Fix Version/s: 3.0.3

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

Backwards Compatibility: Minor Change

 Description   

This is a tracking ticket for https://github.com/mongodb/mongo-cxx-driver/pull/555 :

STL-style containers return const_iterator using methods begin/end for const objects, but your implementation returns non const iterators for const objects.

After consideration, instead of adopting the pull request, we decided to make all iterator const_iterators and to alias the iterator types to their corresponding const_iterator type.



 Comments   
Comment by Githook User [ 08/Nov/16 ]

Author:

{u'username': u'xdg', u'name': u'David Golden', u'email': u'xdg@xdg.me'}

Message: CXX-1068 Fix incomplete bsoncxx iterator API

This commit rationalizes the bsoncxx iterator API for both
bsoncxx::document::view and bsoncxx::array::view:

  • The non-const iterator implementation is removed; for both document::view
    and array::view, iterator is a type alias to const_iterator.
  • begin(), cbegin(), end(), cend(), and find() always return
    a const_iterator.

This replaces and closes #555.
Branch: 3.1-dev
https://github.com/mongodb/mongo-cxx-driver/commit/72ba8fd4ff0a5e292bb2b64b5e15f8ec369dbf33

Comment by Githook User [ 03/Nov/16 ]

Author:

{u'username': u'xdg', u'name': u'David Golden', u'email': u'xdg@xdg.me'}

Message: CXX-1068 Fix incomplete bsoncxx iterator API

This commit rationalizes the bsoncxx iterator API for both
bsoncxx::document::view and bsoncxx::array::view:

  • The non-const iterator implementation is removed; for both document::view
    and array::view, iterator is a type alias to const_iterator.
  • begin(), cbegin(), end(), cend(), and find() always return
    a const_iterator.

This replaces and closes #555.
Branch: master
https://github.com/mongodb/mongo-cxx-driver/commit/72ba8fd4ff0a5e292bb2b64b5e15f8ec369dbf33

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