vcpkg/ports/boost-json/0001-json-array-erase-relocate.patch
Yury Bura 96ec7fb25d
[boost] update to 1.79.0 (#24210)
* [scripts/boost] update to v1.79.0

* [boost-*] re-generate ports

* update versions

* [boost-wave] fix build

* update version

* [fbthrift] fix build compatibility with Boost 1.79.0

* update versions

* [scripts/boost] use vcpkg_replace_string

* update versions
2022-04-21 10:01:54 -07:00

21 lines
573 B
Diff

include/boost/json/impl/array.ipp | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/include/boost/json/impl/array.ipp b/include/boost/json/impl/array.ipp
index 4d067fb..a2c7fd6 100644
--- a/include/boost/json/impl/array.ipp
+++ b/include/boost/json/impl/array.ipp
@@ -491,8 +491,11 @@ erase(
auto const p = &(*t_)[0] +
(pos - &(*t_)[0]);
destroy(p, p + 1);
- relocate(p, p + 1, 1);
--t_->size;
+ if(t_->size > 0)
+ relocate(p, p + 1,
+ t_->size - (p -
+ &(*t_)[0]));
return p;
}