From 97ac4d5f51787c62858a058d2723696bcd21fa54 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Tue, 17 Apr 2018 14:15:07 +0100 Subject: [PATCH] Exploit that construct is variadic --- .../include/CGAL/Arr_dcel_base.h | 10 +++++----- HalfedgeDS/include/CGAL/HalfedgeDS_list.h | 2 +- Hash_map/include/CGAL/Tools/chained_map.h | 2 +- Nef_3/include/CGAL/Nef_3/SNC_structure.h | 14 +++++++------- Union_find/include/CGAL/Union_find.h | 2 +- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_dcel_base.h b/Arrangement_on_surface_2/include/CGAL/Arr_dcel_base.h index c0cf9638136..4a619bef618 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_dcel_base.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_dcel_base.h @@ -1090,7 +1090,7 @@ public: { Vertex* v = vertex_alloc.allocate(1); #ifdef CGAL_CXX11 - std::allocator_traits::construct(vertex_alloc,v, Vertex()); + std::allocator_traits::construct(vertex_alloc,v); #else vertex_alloc.construct(v, Vertex()); #endif @@ -1117,7 +1117,7 @@ public: { Face* f = face_alloc.allocate(1); #ifdef CGAL_CXX11 - std::allocator_traits::construct(face_alloc, f, Face()); + std::allocator_traits::construct(face_alloc, f); #else face_alloc.construct(f, Face()); #endif @@ -1130,7 +1130,7 @@ public: { Outer_ccb* oc = out_ccb_alloc.allocate(1); #ifdef CGAL_CXX11 - std::allocator_traits::construct(out_ccb_alloc, oc, Outer_ccb()); + std::allocator_traits::construct(out_ccb_alloc, oc); #else out_ccb_alloc.construct(oc, Outer_ccb()); #endif @@ -1143,7 +1143,7 @@ public: { Inner_ccb* ic = in_ccb_alloc.allocate(1); #ifdef CGAL_CXX11 - std::allocator_traits::construct(in_ccb_alloc, ic, Inner_ccb()); + std::allocator_traits::construct(in_ccb_alloc, ic); #else in_ccb_alloc.construct(ic, Inner_ccb()); #endif @@ -1156,7 +1156,7 @@ public: { Isolated_vertex* iv = iso_vert_alloc.allocate(1); #ifdef CGAL_CXX11 - std::allocator_traits::construct(iso_vert_alloc, iv, Isolated_vertex()); + std::allocator_traits::construct(iso_vert_alloc, iv); #else iso_vert_alloc.construct(iv, Isolated_vertex()); #endif diff --git a/HalfedgeDS/include/CGAL/HalfedgeDS_list.h b/HalfedgeDS/include/CGAL/HalfedgeDS_list.h index 1b94ac7ab48..a337e69bf85 100644 --- a/HalfedgeDS/include/CGAL/HalfedgeDS_list.h +++ b/HalfedgeDS/include/CGAL/HalfedgeDS_list.h @@ -292,7 +292,7 @@ protected: // creates a new pair of opposite border halfedges. Halfedge_pair* hpair = edge_allocator.allocate(1); #ifdef CGAL_CXX11 - std::allocator_traits::construct(edge_allocator, hpair, Halfedge_pair( h, g)); + std::allocator_traits::construct(edge_allocator, hpair, h, g); #else edge_allocator.construct(hpair, Halfedge_pair( h, g)); #endif diff --git a/Hash_map/include/CGAL/Tools/chained_map.h b/Hash_map/include/CGAL/Tools/chained_map.h index 4a7c424ae84..4be01a751c0 100644 --- a/Hash_map/include/CGAL/Tools/chained_map.h +++ b/Hash_map/include/CGAL/Tools/chained_map.h @@ -163,7 +163,7 @@ void chained_map::init_table(std::size_t t) for (std::size_t i = 0 ; i < t + t/2 ; ++i){ #ifdef CGAL_CXX11 typedef std::allocator_traits Allocator_traits; - std::allocator_traits::construct(alloc,table + i, chained_map_elem()); + std::allocator_traits::construct(alloc,table + i); #else alloc.construct(table + i, chained_map_elem()); #endif diff --git a/Nef_3/include/CGAL/Nef_3/SNC_structure.h b/Nef_3/include/CGAL/Nef_3/SNC_structure.h index e0591d6adc1..b84e87fb11d 100644 --- a/Nef_3/include/CGAL/Nef_3/SNC_structure.h +++ b/Nef_3/include/CGAL/Nef_3/SNC_structure.h @@ -1052,7 +1052,7 @@ public: Vertex* get_vertex_node( const Vertex& ) { Vertex* p = vertex_allocator.allocate(1); #ifdef CGAL_CXX11 - std::allocator_traits::construct(vertex_allocator, p, Vertex()); + std::allocator_traits::construct(vertex_allocator, p); #else vertex_allocator.construct( p, Vertex()); #endif @@ -1071,7 +1071,7 @@ public: Halfedge* get_halfedge_node( const Halfedge&) { Halfedge* p = halfedge_allocator.allocate(1); #ifdef CGAL_CXX11 - std::allocator_traits::construct(halfedge_allocator, p, Halfedge()); + std::allocator_traits::construct(halfedge_allocator, p); #else halfedge_allocator.construct( p, Halfedge()); #endif @@ -1090,7 +1090,7 @@ public: Halffacet* get_halffacet_node( const Halffacet& ) { Halffacet* p = halffacet_allocator.allocate(1); #ifdef CGAL_CXX11 - std::allocator_traits::construct(halffacet_allocator, p, Halffacet()); + std::allocator_traits::construct(halffacet_allocator, p); #else halffacet_allocator.construct( p, Halffacet()); #endif @@ -1109,7 +1109,7 @@ public: Volume* get_volume_node( const Volume& ) { Volume* p = volume_allocator.allocate(1); #ifdef CGAL_CXX11 - std::allocator_traits::construct(volume_allocator, p, Volume()); + std::allocator_traits::construct(volume_allocator, p); #else volume_allocator.construct( p, Volume()); #endif @@ -1128,7 +1128,7 @@ public: SHalfedge* get_shalfedge_node( const SHalfedge& ) { SHalfedge* p = shalfedge_allocator.allocate(1); #ifdef CGAL_CXX11 - std::allocator_traits::construct(shalfedge_allocator, p, SHalfedge()); + std::allocator_traits::construct(shalfedge_allocator, p); #else shalfedge_allocator.construct( p, SHalfedge()); #endif @@ -1147,7 +1147,7 @@ public: SHalfloop* get_shalfloop_node( const SHalfloop& ) { SHalfloop* p = shalfloop_allocator.allocate(1); #ifdef CGAL_CXX11 - std::allocator_traits::construct(shalfloop_allocator, p, SHalfloop()); + std::allocator_traits::construct(shalfloop_allocator, p); #else shalfloop_allocator.construct( p, SHalfloop()); #endif @@ -1166,7 +1166,7 @@ public: SFace* get_sface_node( const SFace& ) { SFace* p = sface_allocator.allocate(1); #ifdef CGAL_CXX11 - std::allocator_traits::construct(sface_allocator, p, SFace()); + std::allocator_traits::construct(sface_allocator, p); #else sface_allocator.construct( p, SFace()); #endif diff --git a/Union_find/include/CGAL/Union_find.h b/Union_find/include/CGAL/Union_find.h index 1d0282a1b86..6ac7e99f7cd 100644 --- a/Union_find/include/CGAL/Union_find.h +++ b/Union_find/include/CGAL/Union_find.h @@ -223,7 +223,7 @@ typename Union_find::handle Union_find::make_set(const T& x) { pointer tmp = m_first; m_first = alloc.allocate(1); #ifdef CGAL_CXX11 - std::allocator_traits::construct(alloc, m_first, Union_find_struct(tmp,x)); + std::allocator_traits::construct(alloc, m_first, tmp, x); #else alloc.construct( m_first, Union_find_struct(tmp,x)); #endif