Boost logo

Boost :

Subject: Re: [boost] [Signal] Variadic template implementation of signal/slot
From: Frank Mori Hess (frank.hess_at_[hidden])
Date: 2009-05-28 15:47:17


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I've checked a variadic signal implementation into Boost.Signals2 on the svn
trunk. It is used when boost detects variadic template support. The code
still looks like macro hell, due to the continuing support for the
non-variadic template implementation, but there is a noticeable improvement
in compilation time. The little hello_world_slot.cpp example program
compiled about 10%-15% faster with gcc 4.3 for example. However, the
variadic Boost.Signals2 implementation still uses Boost.Function for its
default SlotFunction and uses Boost.Bind, neither of which provide variadic
templates implementations. Out of curiosity I tested replacing them locally
with the variadic std::function and std::bind in gcc 4.3, and that also
produced an additional reduction in compile time.

I haven't updated the documentation yet, but the user-visible changes when
using the variadic template implementation are as follows:
1) The "portable syntax" classes like signal0, signal1, etc are gone.
2) The member typedefs like "arg1_type", "arg2_type", etc are gone. They are
replaced with a "arg" member template class, so instead
of "sig_type::arg1_type" you would do "sig_type::arg<0>::type". For
consistency the "arg" member template has also been added to the non-variadic
implementation.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEARECAAYFAkoe6kUACgkQ5vihyNWuA4UvJgCghW2dgyVPAJUhwfHJs+9X+A3f
oCQAoLbW2yIz2Q7u2wWnsGYSaxe1leAA
=NBge
-----END PGP SIGNATURE-----


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