Skip to content

Commit

Permalink
Bug with Linear_cell_complex
Browse files Browse the repository at this point in the history
One cannot call `std::allocator_traits<Alloc>::construct`, because some of linear cell complex classes have protected constructors with a lot of friend classes. They cannot be friend of all possible allocator classes, so...
  • Loading branch information
lrineau committed Jan 31, 2025
1 parent d582ec6 commit b030c4e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion STL_Extension/include/CGAL/Compact_container.h
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ class Compact_container
pointer ret = free_list;
free_list = clean_pointee(ret);
const auto ts = Time_stamper::time_stamp(ret);
std::allocator_traits<allocator_type>::construct(alloc, ret, std::forward<Args>(args)...);
new (ret) value_type(std::forward<Args>(args)...);
Time_stamper::restore_timestamp(ret, ts);
Time_stamper::set_time_stamp(ret, time_stamp);
CGAL_assertion(type(ret) == USED);
Expand Down
4 changes: 2 additions & 2 deletions STL_Extension/include/CGAL/Concurrent_compact_container.h
Original file line number Diff line number Diff line change
Expand Up @@ -353,8 +353,8 @@ class Concurrent_compact_container
pointer ret = init_insert(fl);
auto erase_counter = EraseCounterStrategy<T>::erase_counter(*ret);
const auto ts = Time_stamper::time_stamp(ret);
std::allocator_traits<allocator_type>::construct(m_alloc, ret, std::forward<Args>(args)...);
Time_stamper::restore_timestamp(ret, ts);
new (ret) value_type(std::forward<Args>(args)...);
\ Time_stamper::restore_timestamp(ret, ts);
EraseCounterStrategy<T>::set_erase_counter(*ret, erase_counter);
return finalize_insert(ret, fl);
}
Expand Down

0 comments on commit b030c4e

Please sign in to comment.