Skip to content

Conversation

@grisumbras
Copy link
Member

@grisumbras grisumbras commented Jun 10, 2023

Fix #763

@vinniefalco
Copy link
Member

vinniefalco commented Jun 10, 2023

There is no requirement that capacity is restored to the previous value on an exception.. it is ok to increase capacity and then later fail the insertion - and the object is returned to the caller with the increased capacity.

@grisumbras
Copy link
Member Author

grisumbras commented Jun 10, 2023

If new storage is allocated, then iterators are invalidated and thus, the function doesn't provide the strong guarantee.

@grisumbras
Copy link
Member Author

It's not too hard to revert storage change in our case, so I don't see why we shouldn't. Strong guarantee is a good property.

@cppalliance-bot
Copy link

@grisumbras grisumbras force-pushed the fix/object-strong-guarantee branch from 0fa18a7 to 8f3eb00 Compare June 13, 2023 19:28
@cppalliance-bot
Copy link

@grisumbras grisumbras force-pushed the fix/object-strong-guarantee branch from 8f3eb00 to 8957955 Compare June 14, 2023 06:53
@codecov
Copy link

codecov bot commented Jun 14, 2023

Codecov Report

Merging #907 (8957955) into develop (4700500) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff            @@
##           develop     #907   +/-   ##
========================================
  Coverage    92.98%   92.98%           
========================================
  Files           85       85           
  Lines         8056     8058    +2     
========================================
+ Hits          7491     7493    +2     
  Misses         565      565           
Impacted Files Coverage Δ
include/boost/json/object.hpp 100.00% <ø> (ø)
include/boost/json/impl/object.hpp 100.00% <100.00%> (ø)
include/boost/json/impl/object.ipp 100.00% <100.00%> (ø)

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4700500...8957955. Read the comment docs.

@cppalliance-bot
Copy link

@grisumbras grisumbras merged commit 8957955 into boostorg:develop Jun 14, 2023
@grisumbras grisumbras deleted the fix/object-strong-guarantee branch June 14, 2023 10:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

object operator[] and insert functions invalidate iterators/references

3 participants