|
Boost : |
Subject: Re: [boost] [parameter] function types as named template parameters?
From: Frank Mori Hess (frank.hess_at_[hidden])
Date: 2009-01-23 13:13:42
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Friday 23 January 2009 12:39 pm, David Abrahams wrote:
> This can't really be minimal, can it? Can you reduce it any further?
Ok, how about this version?
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
iD8DBQFJegjY5vihyNWuA4URArnCAKCpuRX9RIfFumpxh5UKjzKaXST+rQCgyI6S
EabXtZi3zH4aW4wsYrdX8YM=
=msBh
-----END PGP SIGNATURE-----
--Boundary-00=_YjgeJGhSYqrDD6r
Content-Type: text/x-c++src; charset="iso-8859-1";
name="parameter_function_type_test.cpp"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename="parameter_function_type_test.cpp"
// Copyright Frank Mori Hess 2009.
// Distributed under the Boost Software License, Version
// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#include <boost/parameter.hpp>
namespace boost
{
namespace fake_signals2
{
namespace keywords
{
BOOST_PARAMETER_TEMPLATE_KEYWORD(signature_type)
} // namespace keywords
template <
typename A0
>
class signal_type
{
typedef parameter::parameters<
parameter::required<keywords::tag::signature_type>
> parameter_spec;
public:
// ArgumentPack
typedef typename
parameter_spec::bind<A0>::type
args;
typedef typename parameter::binding<args, keywords::tag::signature_type>::type
signature_type;
};
} // namespace fake_signals2
} // namespace boost
namespace bs2 = boost::fake_signals2;
int main(int, char*[])
{
using namespace bs2::keywords;
bs2::signal_type<signature_type<void ()> >::signature_type *mysig;
return 0;
}
--Boundary-00=_YjgeJGhSYqrDD6r--
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk