Skip to Content.
Sympa Menu

cgal-discuss - [cgal-discuss] Function_vector without FT_to_point_function_wrapper

Subject: CGAL users discussion list

List archive

[cgal-discuss] Function_vector without FT_to_point_function_wrapper


Chronological Thread 
  • From: Nico Schlömer <>
  • To: "" <>
  • Subject: [cgal-discuss] Function_vector without FT_to_point_function_wrapper
  • Date: Sun, 21 Aug 2016 13:02:49 +0000
  • Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None ; spf=Pass ; spf=None
  • Ironport-phdr: 9a23:ULMe2xWJJr5npyYE6/Po1zJWff/V8LGtZVwlr6E/grcLSJyIuqrYZhyOt8tkgFKBZ4jH8fUM07OQ6PG5HzZRqsvR+DBaKdoXBkdD0Z1X1yUbQ+e9QXXhK/DrayFoVO9jb3RCu0+BDE5OBczlbEfTqHDhpRQbGxH4KBYnbr+tQt2asc272qiI9oHJZE0Q3XzmMOo0dkT98FWZ9pFPx9AzcuBpklqBi0ALUtwe/XlvK1OXkkS0zeaL17knzR5tvek8/dVLS6TwcvdwZ7VZCDM7LzJ9v5Wz5lGQBTeIszEXXWwS1xZJGAPY9wrSX5HrsyK8uPA3kH2RMsTyCLw1Qj+/9LxDSRnyiS5BOSRvo0/NjcklqqNQpyWarBx7XYvZesnBMvt1eeXGdtMeQmdEU9x5WClIA4f6ZIwKWblSdd1EppXw8gNd5SC1AhOhUbvi

Hi everyone,

I'd like to put a custom function into a Function_vector without the FT_to_point_function_wrapper. (Can't use it because I it needs a function pointer and I only have a function pointer to a member function, which is different [1].) Unfortunately, I'm getting tangled up between all the typedefs. I tried
```
template <typename FT, typename P>
class Function: public std::unary_function<P, FT>
{
  typedef P Point;
}

template <typename FT, typename P>
class MySphere: public MyFun
{
public:
  FT operator()(P p) const
  {
    return p.x()*p.x() + p.y()*p.y() + p.z()*p.z() - 1.0;
  }
};
```
with
```
typedef CGAL::Implicit_multi_domain_to_labeling_function_wrapper<Function>
                                                        Function_wrapper;
typedef Function_wrapper::Function_vector Function_vector;
```
and
```
  // Define functions
  MySphere<K::FT, K::Point_3> f1;

  Function_vector v;
  v.push_back(f1);
```
but this only gets me tons of errors, virtually impossible to debug. Any hints here?

Cheers,
Nico

[1] https://isocpp.org/wiki/faq/pointers-to-members#fnptr-vs-memfnptr-types


  • [cgal-discuss] Function_vector without FT_to_point_function_wrapper, Nico Schlömer, 08/21/2016

Archive powered by MHonArc 2.6.18.

Top of Page