[range] why not adding conversion operator std::pair<FTI.FTI> to boost iterator_range
Wouldn't it be a good idea to add a conversion operator to the class iterator_range? This would allow to write functions returning a range, instead of a pair of iterators, but boost::tie would still work with it. Best regards, andreas -- Andreas Fabri, PhD Chief Officer, GeometryFactory Editor, The CGAL Project phone: +33.492.954.912 skype: andreas.fabri
On Wednesday 11 June 2014 08:58:44 Andreas Fabri wrote:
Wouldn't it be a good idea to add a conversion operator to the class iterator_range?
I suppose, the problem is that there is no reliable way to know that a certain type T is an iterator.
By contract it is an ForwardTraversalIterator template< class ForwardTraversalIterator > class iterator_range http://www.boost.org/doc/libs/1_55_0/libs/range/doc/html/range/reference/uti... andreas On 11/06/2014 14:34, Andrey Semashev wrote:
On Wednesday 11 June 2014 08:58:44 Andreas Fabri wrote:
Wouldn't it be a good idea to add a conversion operator to the class iterator_range?
I suppose, the problem is that there is no reliable way to know that a certain type T is an iterator.
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
-- Andreas Fabri, PhD Chief Officer, GeometryFactory Editor, The CGAL Project phone: +33.492.954.912 skype: andreas.fabri
On Wednesday 11 June 2014 14:49:48 Andreas Fabri wrote:
On 11/06/2014 14:34, Andrey Semashev wrote:
On Wednesday 11 June 2014 08:58:44 Andreas Fabri wrote:
Wouldn't it be a good idea to add a conversion operator to the class iterator_range?
I suppose, the problem is that there is no reliable way to know that a certain type T is an iterator.
By contract it is an ForwardTraversalIterator
template< class ForwardTraversalIterator > class iterator_range
Yes, but AFAIK this requirement is not enforced in code. The implementation should prohibit conversion from pairs of types that are not model of this concept. Implementing that check might be difficult or heavy for the rest use cases.
On 11 Jun 2014 13:25, "Andreas Fabri"
Wouldn't it be a good idea to add a conversion operator to the class iterator_range?
This would allow to write functions returning a range, instead of a pair of iterators, but boost::tie would still work with it.
Yes it is a good idea. It is already one of my scheduled tasks. I'm close to doing this.
Best regards,
andreas
Regards, Neil Groves
-- Andreas Fabri, PhD Chief Officer, GeometryFactory Editor, The CGAL Project
phone: +33.492.954.912 skype: andreas.fabri
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
participants (3)
-
Andreas Fabri
-
Andrey Semashev
-
Neil Groves