[libstdc++ PATH] tr1::bind support

Chris Jefferson caj@cs.york.ac.uk
Sun Mar 20 23:01:00 GMT 2005


Douglas Gregor wrote:
> Hello,
> 
> The attached patch introduces support for tr1::bind for libstdc++-v3 (section 
> 3.6 of TR1). Tested against i686-pc-linux-gnu, no regressions. This 
> particular patch is against the main trunk (4.1.0), but I would like to 
> commit to both the main trunk and the 4.0 branch. ChangeLog follows.
> 
> Details for those that wish to review the internals:
> <snip>
>   1) It is a function object (with enough smarts to work with result_of), but 
> always takes two parameters: a reference to the bound argument and a tuple of 
> the arguments that were passed to bind. We use a tuple so that we require 
> less repetition. However, it also means that we're limited to passing 10 
> arguments to bind() because tuple<> accepts at most 10 parameters. See 
> workarounds in, e.g., mu_iterate.h.

I've briefly looked over the library and it seems good at a brief glance 
:) Note that tuple is going to gain more than 10 parameters, as soon as 
we decide the best way of macroising things. The two implementations 
floating around (generate from a C file, which is in 4.0 and I suspect 
will stay there now, and a preprocessor library) can both cope with more 
than 10 paraneters.

Does the general opinion seem to be that the system used by the 
non-tuple tr1 headers (non-intellegent repeated inclusion of header) the 
best way to go? Or does anyone else have a preference on which way to go? :)

Chris



More information about the Libstdc++ mailing list