cosmetic changes

This commit is contained in:
Laurent Rineau 2018-04-17 16:42:25 +02:00
parent 00ebc78c1d
commit 095c27e2be
21 changed files with 82 additions and 83 deletions

View File

@ -916,7 +916,7 @@ protected:
typedef typename Allocator_traits::template rebind_alloc<Outer_ccb> Outer_ccb_allocator; typedef typename Allocator_traits::template rebind_alloc<Outer_ccb> Outer_ccb_allocator;
typedef typename Allocator_traits::template rebind_alloc<Inner_ccb> Inner_ccb_allocator; typedef typename Allocator_traits::template rebind_alloc<Inner_ccb> Inner_ccb_allocator;
typedef typename Allocator_traits::template rebind_alloc<Isolated_vertex> Iso_vert_allocator; typedef typename Allocator_traits::template rebind_alloc<Isolated_vertex> Iso_vert_allocator;
#else #else // not CGAL_CXX11
// Vertex allocator. // Vertex allocator.
typedef typename Allocator::template rebind<Vertex> Vertex_alloc_rebind; typedef typename Allocator::template rebind<Vertex> Vertex_alloc_rebind;
typedef typename Vertex_alloc_rebind::other Vertex_allocator; typedef typename Vertex_alloc_rebind::other Vertex_allocator;
@ -941,7 +941,7 @@ protected:
typedef typename Allocator::template rebind<Isolated_vertex> typedef typename Allocator::template rebind<Isolated_vertex>
Iso_vert_alloc_rebind; Iso_vert_alloc_rebind;
typedef typename Iso_vert_alloc_rebind::other Iso_vert_allocator; typedef typename Iso_vert_alloc_rebind::other Iso_vert_allocator;
#endif #endif // not CGAL_CXX11
public: public:
typedef typename Halfedge_list::size_type Size; typedef typename Halfedge_list::size_type Size;

View File

@ -1557,7 +1557,7 @@ protected:
{ {
Point_2* p_pt = m_points_alloc.allocate(1); Point_2* p_pt = m_points_alloc.allocate(1);
#ifdef CGAL_CXX11 #ifdef CGAL_CXX11
std::allocator_traits<Points_alloc>::construct(m_points_alloc, p_pt, pt); std::allocator_traits<Points_alloc>::construct(m_points_alloc, p_pt, pt);
#else #else
m_points_alloc.construct(p_pt, pt); m_points_alloc.construct(p_pt, pt);
#endif #endif

View File

@ -67,10 +67,9 @@ namespace CGAL {
#ifdef CGAL_CXX11 #ifdef CGAL_CXX11
typedef std::allocator_traits<Alloc_> Allocator_traits; typedef std::allocator_traits<Alloc_> Allocator_traits;
typedef typename Allocator_traits::template rebind_alloc<Dart> Dart_allocator; typedef typename Allocator_traits::template rebind_alloc<Dart> Dart_allocator;
#else #else // not CGAL_CXX11
typedef typename Alloc_::template rebind<Dart>::other Dart_allocator; typedef typename Alloc_::template rebind<Dart>::other Dart_allocator;
#endif #endif // not CGAL_CXX11
typedef Compact_container<Dart, Dart_allocator> Dart_container; typedef Compact_container<Dart, Dart_allocator> Dart_container;
typedef typename Dart_container::iterator Dart_handle; typedef typename Dart_container::iterator Dart_handle;

View File

@ -121,7 +121,7 @@ public:
typedef typename Allocator_traits::template rebind_alloc<Vertex> Vertex_allocator; typedef typename Allocator_traits::template rebind_alloc<Vertex> Vertex_allocator;
typedef typename Allocator_traits::template rebind_alloc<Halfedge> Halfedge_allocator; typedef typename Allocator_traits::template rebind_alloc<Halfedge> Halfedge_allocator;
typedef typename Allocator_traits::template rebind_alloc<Face> Face_allocator; typedef typename Allocator_traits::template rebind_alloc<Face> Face_allocator;
#else #else // CGAL_CXX11
typedef typename Allocator::template rebind< Vertex> Vertex_alloc_rebind; typedef typename Allocator::template rebind< Vertex> Vertex_alloc_rebind;
typedef typename Vertex_alloc_rebind::other Vertex_allocator; typedef typename Vertex_alloc_rebind::other Vertex_allocator;
typedef typename Allocator::template rebind< Halfedge> typedef typename Allocator::template rebind< Halfedge>
@ -129,7 +129,7 @@ public:
typedef typename Halfedge_alloc_rebind::other Halfedge_allocator; typedef typename Halfedge_alloc_rebind::other Halfedge_allocator;
typedef typename Allocator::template rebind< Face> Face_alloc_rebind; typedef typename Allocator::template rebind< Face> Face_alloc_rebind;
typedef typename Face_alloc_rebind::other Face_allocator; typedef typename Face_alloc_rebind::other Face_allocator;
#endif #endif // not CGAL_CXX11
typedef In_place_list<Vertex,false,Vertex_allocator> Vertex_list; typedef In_place_list<Vertex,false,Vertex_allocator> Vertex_list;
typedef typename Vertex_list::iterator Vertex_handle; typedef typename Vertex_list::iterator Vertex_handle;
@ -264,15 +264,15 @@ protected:
Edge_allocator edge_allocator; // allocates pairs of halfedges Edge_allocator edge_allocator; // allocates pairs of halfedges
Face_allocator face_allocator; Face_allocator face_allocator;
template <typename A, typename T> template <typename A, typename T>
void destroy(A& a, const T& t) void destroy(A& a, const T& t)
{ {
#ifdef CGAL_CXX11 #ifdef CGAL_CXX11
std::allocator_traits<A>::destroy(a,t); std::allocator_traits<A>::destroy(a,t);
#else #else
a.destroy(t); a.destroy(t);
#endif #endif
} }
Vertex* get_vertex_node( const Vertex& t) { Vertex* get_vertex_node( const Vertex& t) {
Vertex* p = vertex_allocator.allocate(1); Vertex* p = vertex_allocator.allocate(1);

View File

@ -71,7 +71,7 @@ public:
typedef typename Allocator_traits::template rebind_alloc<Vertex> Vertex_allocator; typedef typename Allocator_traits::template rebind_alloc<Vertex> Vertex_allocator;
typedef typename Allocator_traits::template rebind_alloc<Halfedge> Halfedge_allocator; typedef typename Allocator_traits::template rebind_alloc<Halfedge> Halfedge_allocator;
typedef typename Allocator_traits::template rebind_alloc<Face> Face_allocator; typedef typename Allocator_traits::template rebind_alloc<Face> Face_allocator;
#else #else // not CGAL_CXX11
typedef typename Allocator::template rebind< Vertex> Vertex_alloc_rebind; typedef typename Allocator::template rebind< Vertex> Vertex_alloc_rebind;
typedef typename Vertex_alloc_rebind::other Vertex_allocator; typedef typename Vertex_alloc_rebind::other Vertex_allocator;
typedef typename Allocator::template rebind< Halfedge> typedef typename Allocator::template rebind< Halfedge>
@ -79,7 +79,7 @@ public:
typedef typename Halfedge_alloc_rebind::other Halfedge_allocator; typedef typename Halfedge_alloc_rebind::other Halfedge_allocator;
typedef typename Allocator::template rebind< Face> Face_alloc_rebind; typedef typename Allocator::template rebind< Face> Face_alloc_rebind;
typedef typename Face_alloc_rebind::other Face_allocator; typedef typename Face_alloc_rebind::other Face_allocator;
#endif #endif // not CGAL_CXX11
#ifdef CGAL__HALFEDGEDS_USE_INTERNAL_VECTOR #ifdef CGAL__HALFEDGEDS_USE_INTERNAL_VECTOR
typedef internal::vector<Vertex, Vertex_allocator> Vertex_vector; typedef internal::vector<Vertex, Vertex_allocator> Vertex_vector;

View File

@ -65,13 +65,13 @@ class chained_map
std::size_t old_index; std::size_t old_index;
#ifdef CGAL_CXX11 #ifdef CGAL_CXX11
typedef std::allocator_traits<Allocator> Allocator_traits; typedef std::allocator_traits<Allocator> Allocator_traits;
typedef typename Allocator_traits::template rebind_alloc<chained_map_elem<T> > allocator_type; typedef typename Allocator_traits::template rebind_alloc<chained_map_elem<T> > allocator_type;
#else #else
typedef typename Allocator::template rebind<chained_map_elem<T> >::other allocator_type; typedef typename Allocator::template rebind<chained_map_elem<T> >::other allocator_type;
#endif #endif
allocator_type alloc; allocator_type alloc;
public: public:
T& xdef() { return STOP.i; } T& xdef() { return STOP.i; }
@ -89,15 +89,15 @@ private:
inline void insert(std::size_t x, T y); inline void insert(std::size_t x, T y);
void destroy(chained_map_elem<T>* item) void destroy(chained_map_elem<T>* item)
{ {
#ifdef CGAL_CXX11 #ifdef CGAL_CXX11
typedef std::allocator_traits<allocator_type> Allocator_type_traits; typedef std::allocator_traits<allocator_type> Allocator_type_traits;
Allocator_type_traits::destroy(alloc,item); Allocator_type_traits::destroy(alloc,item);
#else #else
alloc.destroy(item); alloc.destroy(item);
#endif #endif
} }
public: public:
typedef chained_map_elem<T>* chained_map_item; typedef chained_map_elem<T>* chained_map_item;

View File

@ -93,7 +93,7 @@ namespace CGAL {
#ifdef CGAL_CXX11 #ifdef CGAL_CXX11
template <typename T> template <typename T>
struct Container_for_attributes : struct Container_for_attributes :
public Compact_container<T, typename std::allocator_traits<Alloc_>::template rebind_alloc<T> > public Compact_container<T, typename std::allocator_traits<Alloc_>::template rebind_alloc<T> >
{}; {};
#else #else
template <typename T> template <typename T>

View File

@ -59,7 +59,7 @@ class Handle_for
typedef typename Alloc_traits::template rebind_traits<RefCounted>::pointer pointer; typedef typename Alloc_traits::template rebind_traits<RefCounted>::pointer pointer;
#else #else
typedef typename Alloc_::template rebind<RefCounted>::other Allocator; typedef typename Alloc_::template rebind<RefCounted>::other Allocator;
typedef typename Allocator::pointer pointer; typedef typename Allocator::pointer pointer;
#endif #endif
static Allocator allocator; static Allocator allocator;

View File

@ -295,12 +295,12 @@ protected:
} }
void put_node( pointer p) { void put_node( pointer p) {
#ifdef CGAL_USE_ALLOCATOR_CONSTRUCT_DESTROY #ifdef CGAL_USE_ALLOCATOR_CONSTRUCT_DESTROY
#ifdef CGAL_CXX11 # ifdef CGAL_CXX11
std::allocator_traits<Allocator>::destroy(allocator, p); std::allocator_traits<Allocator>::destroy(allocator, p);
#else # else
allocator.destroy( p); allocator.destroy( p);
#endif # endif
#else #else // not CGAL_USE_ALLOCATOR_CONSTRUCT_DESTROY
p->~value_type(); p->~value_type();
#endif #endif
allocator.deallocate( p, 1); allocator.deallocate( p, 1);

View File

@ -142,9 +142,9 @@ void No_intersection_surface_sweep_2<Vis>::deallocate_event(Event* event)
// Perfrom the actual deallocation. // Perfrom the actual deallocation.
#ifdef CGAL_CXX11 #ifdef CGAL_CXX11
std::allocator_traits<Event_alloc>::destroy(m_eventAlloc, event); std::allocator_traits<Event_alloc>::destroy(m_eventAlloc, event);
#else #else
m_eventAlloc.destroy(event); m_eventAlloc.destroy(event);
#endif #endif
m_eventAlloc.deallocate(event, 1); m_eventAlloc.deallocate(event, 1);
} }
@ -271,7 +271,7 @@ _init_curve(const X_monotone_curve_2& curve, unsigned int index)
{ {
// Construct and initialize a subcurve object. // Construct and initialize a subcurve object.
#ifdef CGAL_CXX11 #ifdef CGAL_CXX11
std::allocator_traits<Subcurve_alloc>::construct(m_subCurveAlloc, m_subCurves + index, m_masterSubcurve ); std::allocator_traits<Subcurve_alloc>::construct(m_subCurveAlloc, m_subCurves + index, m_masterSubcurve );
#else #else
m_subCurveAlloc.construct(m_subCurves + index, m_masterSubcurve); m_subCurveAlloc.construct(m_subCurves + index, m_masterSubcurve);
#endif #endif
@ -615,9 +615,9 @@ No_intersection_surface_sweep_2<Vis>::_allocate_event(const Point_2& pt,
// Allocate the event. // Allocate the event.
Event* e = m_eventAlloc.allocate(1); Event* e = m_eventAlloc.allocate(1);
#ifdef CGAL_CXX11 #ifdef CGAL_CXX11
std::allocator_traits<Event_alloc>::construct(m_eventAlloc, e, m_masterEvent); std::allocator_traits<Event_alloc>::construct(m_eventAlloc, e, m_masterEvent);
#else #else
m_eventAlloc.construct(e, m_masterEvent); m_eventAlloc.construct(e, m_masterEvent);
#endif #endif
e->init(pt, type, ps_x, ps_y); e->init(pt, type, ps_x, ps_y);
@ -639,9 +639,9 @@ _allocate_event_at_open_boundary(Attribute type,
{ {
Event* e = m_eventAlloc.allocate(1); Event* e = m_eventAlloc.allocate(1);
#ifdef CGAL_CXX11 #ifdef CGAL_CXX11
std::allocator_traits<Event_alloc>::construct(m_eventAlloc, e, m_masterEvent); std::allocator_traits<Event_alloc>::construct(m_eventAlloc, e, m_masterEvent);
#else #else
m_eventAlloc.construct(e, m_masterEvent); m_eventAlloc.construct(e, m_masterEvent);
#endif #endif
e->init_at_open_boundary(type, ps_x, ps_y); e->init_at_open_boundary(type, ps_x, ps_y);