Boost logo

Boost :

From: Douglas Gregor (gregod_at_[hidden])
Date: 2003-10-11 07:56:28


On Saturday 11 October 2003 02:59 am, Firingme wrote:
> I have a templated class named Point3D as following :
>
> template < typename T >
> class Point3D
> {
> public:
> typedef T PointType ;
> Point3D* SetX(const T& x) { m_X = x ; return this ; }
> Point3D* SetY(const T& y) { m_Y = y ; return this ; }
> Point3D* SetZ(const T& z) { m_Z = z ; return this ; }
>
> T m_X,m_Y,m_Z ;
> };
>
> Now, I want make a boost::function point to the fun: Point3D::SetX,
> How can I write my code ?

boost::function<Point3D<T>* (Point3D<T>& self, const T& x)> f
  = &Point3D<T>::SetX;

        Doug


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk