|
Boost : |
Subject: Re: [boost] [Signal] Variadic template implementation of signal/slot
From: Frank Mori Hess (frank.hess_at_[hidden])
Date: 2009-05-22 15:58:46
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Friday 22 May 2009, Frank Mori Hess wrote:
> I guess you'll have to wrap all the non-signature template parameters for
> the signal in a policy class that can be passed as the first template
> parameter to variadic_signal, since the variadic template parameter pack
> has to be last.
Actually, after playing around with variadic templates a bit more and looking
at the spec of the variadic std::function in c++0x, it looks like you can use
partial template specialization and function types to match how the current
signal class looks. Something like:
template<typename Signature, typename DefaultedType=int> class myclass;
template<typename DefaultedType, typename R, ... Args>
class myclass<R(Args...), DefaultedType>
{
//...
}
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
iEYEARECAAYFAkoXA/YACgkQ5vihyNWuA4UrpgCeOwo0x2T1K8cRQIhl71bJlFfu
6EEAn3wQVEGiYz2hPeT1O4E5raC9ohEO
=DdBz
-----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