Boost logo

Boost :

From: Jason.Sibthorpe_at_[hidden]
Date: 2003-09-15 05:08:48


Apologies - I should have been clear.

http://mail.python.org/pipermail/c++-sig/2003-September/005467.html

I was referring to boost python see above. Dave Abrahams kindly
answered.

Thanks

-----Original Message-----
From: Daron Anderson [mailto:dnanderson_at_[hidden]]
Sent: 15 September 2003 07:02
To: boost_at_[hidden]
Subject: [boost] Re: pointer to pointer

>Does anyone know how to wrap a function taking a pointer to
>pointer to a type? (or where to look in the documentation)

When you say 'wrap', are you talking about using the Boost.Function library
as a wrapping mechanism for a free function? If so, a basic tutorial is
available at

http://www.boost.org/doc/html/function.tutorial.html

This tutorial does not explicitly point out any difference between
references, object names, pointers, pointers to pointers, etc., since they
are equally usable through the template parameters. For example the
following code compiles properly on a MSVC++ 6.0 compiler. See the tutorial
for a list of 'preferred' syntax, if you have a more standards-compliant
compiler.

/////////////////////////////////////////////////////////
//
#include <boost\function\function1.hpp>

// this is the function to be wrapped
void raw_function( int** ppi )
{
 // do something with ppi
}

void fn()
{
 // this is the wrapper for the function
 boost::function1< void, int** > fn1;

 // assign the function to the wrapper
 fn1 = &raw_function;

 // create a pointer to pointer and call the function
 int* ppi;
 fn1( &ppi );
}

Is this example sufficient,or have I misunderstood what you are looking for?

_______________________________________________
Unsubscribe & other changes:
http://lists.boost.org/mailman/listinfo.cgi/boost


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