Subject: CGAL users discussion list
List archive
- From: RossH <>
- To:
- Subject: [cgal-discuss] Re: Applying a functor to CGAL iterator ranges.
- Date: Wed, 6 Feb 2013 07:06:14 -0800 (PST)
Philipp Moeller-2 wrote
> I'm think you can write the necessary trait to detect if your functor is
> callable with an lvalue of a certain type in C++03. There are a some
> tricky parts when it comes to const qualification and behavior for
> iterators where *it doesn't return a T&, but it should be possible.
What did you have in mind for this? I tried using standard SFINAE
tricks but didn't get that far (I want the code to be very portable:
so avoiding result_of or decltype).
Philipp Moeller-2 wrote
> On the other hand: Your functor can always cheat a
> little. Triangulation_data_structure_2 is using Compact_container (this
> is even publicly documented), which allows you to get an iterator/handle
> from a value through Compact_container::s_iterator_to.
This would seem to mean that I would need to change the
input type to the functors (and I want to keep the input as handles,
to match other CGAL routines).
- I think the best solution I have found is to add a ::result_type and
::argument_type
(or similar) to all my functors. It's not hugely elegant, but at least it's
easy to understand.
Would still like to hear about any ways to do this automatically :)
--
View this message in context:
http://cgal-discuss.949826.n4.nabble.com/Applying-a-functor-to-CGAL-iterator-ranges-tp4656663p4656673.html
Sent from the cgal-discuss mailing list archive at Nabble.com.
- [cgal-discuss] Applying a functor to CGAL iterator ranges., Ross Hemsley, 02/05/2013
- Re: [cgal-discuss] Applying a functor to CGAL iterator ranges., Cody Rose, 02/05/2013
- [cgal-discuss] Re: Applying a functor to CGAL iterator ranges., RossH, 02/05/2013
- Re: [cgal-discuss] Re: Applying a functor to CGAL iterator ranges., Cody Rose, 02/05/2013
- [cgal-discuss] Re: Applying a functor to CGAL iterator ranges., RossH, 02/06/2013
- Re: [cgal-discuss] Re: Applying a functor to CGAL iterator ranges., Cody Rose, 02/05/2013
- [cgal-discuss] Re: Applying a functor to CGAL iterator ranges., RossH, 02/05/2013
- Re: [cgal-discuss] Applying a functor to CGAL iterator ranges., Philipp Moeller, 02/05/2013
- [cgal-discuss] Re: Applying a functor to CGAL iterator ranges., RossH, 02/06/2013
- Re: [cgal-discuss] Applying a functor to CGAL iterator ranges., Cody Rose, 02/05/2013
Archive powered by MHonArc 2.6.18.