|
Boost : |
From: Daniel Wallin (dalwan01_at_[hidden])
Date: 2006-02-09 11:33:36
1.34 will feature new macros in Boost.Parameter that have a
significantly improved interface. Some of the syntax is demonstrated in
this test:
http://cvs.sourceforge.net/viewcvs.py/*checkout*/boost/boost/libs/parameter/test/preprocessor.cpp
They also support in/out parameter overload generation, like what you
have here. The syntax for this will be:
BOOST_PARAMETER_FUNCTION((int), f, tag,
(required
(out(tester), *)
^^^
(name, *)
)
)
Cromwell Enage wrote:
> I've implemented a new macro, BOOST_PARAMETER_FUN2,
> that uses approach #3 mentioned in
> <http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2002/n1385.htm>.
> For example, the BGL implementation of Dijkstra's
> algorithm
> <http://www.boost.org/libs/graph/doc/dijkstra_shortest_paths.html>
> can now be declared as:
>
> struct dijkstra_parameters
> : parameter::parameters<...>
> {
> }
>
> BOOST_PARAMETER_FUN2(
> void
> , dijkstra_shortest_paths
> , (0)(0)(1)(1)(0)(0)(0)(0)(0)(0)(1)(1)
> , 2
> , dijkstra_parameters
> )
> {
> ...
> }
>
> Each element in the Boost.Preprocessor sequence
> corresponds to a positional argument. If the element
> is set to 1, the argument is bound to an "out"
> parameter; otherwise it is bound to an "in" parameter.
> The size of the sequence is, of course, the total
> number of arguments accepted by the function.
-- Daniel Wallin
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk