Fix detection of CGAL_CXX11 for VC++ and fixes of usage of std::allocator_traits

This commit is contained in:
Andreas Fabri 2018-04-16 11:00:03 +01:00
parent 0cccc34cad
commit 303b0ab46e
4 changed files with 13 additions and 15 deletions

View File

@ -259,7 +259,7 @@
// Some random list to let us write C++11 without thinking about
// each feature we are using.
#if __cplusplus >= 201103L && \
#if ( __cplusplus >= 201103L || _MSVC_LANG >= 201103L ) && \
!defined CGAL_CFG_NO_CPP0X_VARIADIC_TEMPLATES && \
!defined CGAL_CFG_NO_CPP0X_RVALUE_REFERENCE && \
!defined CGAL_CFG_NO_CPP0X_EXPLICIT_CONVERSION_OPERATORS && \

View File

@ -253,24 +253,23 @@ public:
typedef T value_type;
typedef Allocator allocator_type;
typedef value_type& reference;
typedef const value_type& const_reference;
#ifdef CGAL_CXX11
typedef typename std::allocator_traits<Allocator>::reference reference;
typedef typename std::allocator_traits<Allocator>::const_reference const_reference;
typedef typename std::allocator_traits<Allocator>::pointer pointer;
typedef typename std::allocator_traits<Allocator>::const_pointer const_pointer;
typedef typename std::allocator_traits<Allocator>::size_type size_type;
typedef typename std::allocator_traits<Allocator>::difference_type difference_type;
#else
typedef typename Allocator::reference reference;
typedef typename Allocator::const_reference const_reference;
typedef typename Allocator::pointer pointer;
typedef typename Allocator::const_pointer const_pointer;
typedef typename Allocator::size_type size_type;
typedef typename Allocator::difference_type difference_type;
#endif
typedef internal::CC_iterator<Self, false> iterator;
typedef internal::CC_iterator<Self, true> const_iterator;
typedef internal::CC_iterator<Self, false> iterator;
typedef internal::CC_iterator<Self, true> const_iterator;
typedef std::reverse_iterator<iterator> reverse_iterator;
typedef std::reverse_iterator<const_iterator> const_reverse_iterator;

View File

@ -177,16 +177,15 @@ public:
typedef T value_type;
typedef Allocator allocator_type;
typedef value_type& reference;
typedef const value_type& const_reference;
#ifdef CGAL_CXX11
typedef typename std::allocator_traits<Allocator>::reference reference;
typedef typename std::allocator_traits<Allocator>::const_reference const_reference;
typedef typename std::allocator_traits<Allocator>::pointer pointer;
typedef typename std::allocator_traits<Allocator>::const_pointer const_pointer;
typedef typename std::allocator_traits<Allocator>::size_type size_type;
typedef typename std::allocator_traits<Allocator>::difference_type difference_type;
#else
typedef typename Allocator::reference reference;
typedef typename Allocator::const_reference const_reference;
typedef typename Allocator::pointer pointer;
typedef typename Allocator::const_pointer const_pointer;
typedef typename Allocator::size_type size_type;

View File

@ -238,24 +238,24 @@ public:
// Note: the standard requires the following types to be equivalent
// to T, T*, const T*, T&, const T&, size_t, and ptrdiff_t, respectively.
// So we don't pass these types to the iterators explicitly.
#ifdef CGAL_CXX11
typedef typename std::allocator_traits<Allocator>::value_type value_type;
typedef typename std::allocator_traits<Allocator>::pointer pointer;
typedef typename std::allocator_traits<Allocator>::const_pointer const_pointer;
typedef typename std::allocator_traits<Allocator>::reference reference;
typedef typename std::allocator_traits<Allocator>::const_reference const_reference;
typedef typename std::allocator_traits<Allocator>::size_type size_type;
typedef typename std::allocator_traits<Allocator>::difference_type difference_type;
#else
typedef typename Allocator::value_type value_type;
typedef typename Allocator::pointer pointer;
typedef typename Allocator::const_pointer const_pointer;
typedef typename Allocator::reference reference;
typedef typename Allocator::const_reference const_reference;
typedef typename Allocator::size_type size_type;
typedef typename Allocator::difference_type difference_type;
#endif
typedef value_type& reference;
typedef const value_type& const_reference;
typedef internal::In_place_list_iterator<T, Alloc> iterator;
typedef internal::In_place_list_const_iterator<T, Alloc> const_iterator;