[sigc] Re: distribute/install m4 files [was: Re: libsigc++ article]



Am 2003.11.08 21:23 schrieb(en) rsteinke w-link net:
Okay, a few more thoughts on my part about the m4 macros files, now
that
I've examined the code a bit more.

> From: Murray Cumming <murrayc usa net>
>
> On Sun, 2003-11-02 at 00:07, rsteinke w-link net wrote:
> > Is there a reason the m4 macro files are no longer installed? They
were
> > used in the past to allow users to generate signals with large
numbers of
> > arguments (10, 12, whatever).
>
> How many arguments do you actually need. If it is just one or two
more
> then maybe we can ship libsigc++ with that many.
>
> I can't believe that anybody needs 10 parameter arguments. Even in
perl,
> eventually it's time to make an object.

Looking through fucntors/slot.h, I see that the redesign really does
limit
you to 7 arguments, due to the way sigc::slot<> is written.

You have a point here. The way it is designed now, you'd have to
replace the sigc::signal<> and sigc::slot<> templates with your own
to get more arguments.
Or use locally patched header files. This should work since the
code that is compiled into the shared library isn't affected by the
templates. For this pupose and in order to demonstrate how to code
functors and adaptors the libsigc++ way, it still reasonable to
distribute the m4 files in the tarball. However, it might prove
unnecessary to install the m4 files.

This
shouldn't
be a problem, I was just remembering the old way where you could
generate
more signals easily with macros. That no longer appears to be the
case.

What about the retyping functions? Under 1.2, the lib provided one and
two
argument hide() functions, and you could generate functions to hide
larger
numbers of arguments with the macros. Would providing the macros still
allow
this sort of thing, or have the internal changes been large enough
that
this too is no longer feasible.

Indeed, hide() can only hide one argument at a time, now. You needn't
specify the types of the arguments to hide any more but of course this
means that the number of arguments to hide cannot be deduced from the
number of template arguments given.
It is trivial to implement hide2(), hide3(), etc. without even having
to define new functor, but the m4 macros don't help to create the
functions.

For bind(), the number of arguments to bind is deduced from the number
of arguments passed into bind(). However, the implementation for >1
arguments resides in the bind() function, now, so that again the m4
templates are not needed to derive variants for more arguments.

Regards,

  Martin



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]