mirror of https://github.com/CGAL/cgal
Add a reserve before to copy attribute (to solve a bug for index versions)
This commit is contained in:
parent
72b356d309
commit
8dc54d3c62
|
|
@ -288,6 +288,13 @@ namespace CGAL {
|
|||
{
|
||||
CGAL_static_assertion_msg(Helper::template Dimension_index<i>::value>=0,
|
||||
"copy_attribute<i> called but i-attributes are disabled.");
|
||||
// We need to do a reserve before the emplace in order to avoid a bug of
|
||||
// invalid reference when the container is reallocated.
|
||||
std::get<Helper::template Dimension_index<i>::value>
|
||||
(mattribute_containers).reserve
|
||||
(std::get<Helper::template Dimension_index<i>::value>
|
||||
(mattribute_containers).size()+1);
|
||||
|
||||
typename Attribute_descriptor<i>::type res=
|
||||
std::get<Helper::template Dimension_index<i>::value>
|
||||
(mattribute_containers).emplace(get_attribute<i>(ah));
|
||||
|
|
|
|||
|
|
@ -242,6 +242,13 @@ namespace CGAL {
|
|||
{
|
||||
CGAL_static_assertion_msg(Helper::template Dimension_index<i>::value>=0,
|
||||
"copy_attribute<i> called but i-attributes are disabled.");
|
||||
// We need to do a reserve before the emplace in order to avoid a bug of
|
||||
// invalid reference when the container is reallocated.
|
||||
std::get<Helper::template Dimension_index<i>::value>
|
||||
(mattribute_containers).reserve
|
||||
(std::get<Helper::template Dimension_index<i>::value>
|
||||
(mattribute_containers).size()+1);
|
||||
|
||||
typename Attribute_descriptor<i>::type res=
|
||||
std::get<Helper::template Dimension_index<i>::value>
|
||||
(mattribute_containers).emplace(get_attribute<i>(ah));
|
||||
|
|
|
|||
Loading…
Reference in New Issue