File tree Expand file tree Collapse file tree 1 file changed +18
-2
lines changed
STL_Extension/include/CGAL Expand file tree Collapse file tree 1 file changed +18
-2
lines changed Original file line number Diff line number Diff line change 1919#ifndef CGAL_ITERATOR_PROJECT_H
2020#define CGAL_ITERATOR_PROJECT_H 1
2121
22+ #include < CGAL/config.h>
2223#include < iterator>
2324
2425namespace CGAL {
@@ -136,8 +137,23 @@ class Iterator_project {
136137 Self tmp = *this ;
137138 return tmp += -n;
138139 }
139- difference_type operator -( const Self& i) const { return nt - i.nt ; }
140- reference operator []( difference_type n) const {
140+
141+ #if defined(BOOST_MSVC)
142+ difference_type operator - (const Self& i) const {
143+ return nt - i.nt ;
144+ }
145+ #else
146+
147+ template <typename It>
148+ std::enable_if_t <std::is_convertible_v<iterator_category, std::random_access_iterator_tag>
149+ && std::is_convertible_v<const It&, const Self&>,
150+ difference_type>
151+ operator - (const It& i) const {
152+ return nt - i.nt ;
153+ }
154+ #endif
155+
156+ reference operator []( difference_type n) const {
141157 Self tmp = *this ;
142158 tmp += n;
143159 return tmp.operator *();
You can’t perform that action at this time.
0 commit comments