Hi, everybody.
I'm trying to synthesize a
function type G from another function type F with some changes on return and
arg types. What I need to leave constant, are all these additional properties
that are returned by components<F>::tag. I want them all as a bunch,
don't really fancy querying them one by one, they sorta look contradictive or
at least redundant.
The naive approach of passing the same tag to the
function_type<Seq, Tag> does not make a change -
it leads to the same result as if default null_tag
were passed.
How do you generate a function type with the same additional
properties as the given one?
Sample
code:
//--------------------------------------------------------------------------------------------------
typedef int (__stdcall * pF)(char);
typedef int
( * pG)(char);
typedef remove_pointer<pF>::type
F;
typedef components<F>
compsF;
// generate type hopefully like pF
typedef function_pointer<compsF,
//create tag from mask and bits
detail::property_tag<compsF::bits::value, compsF::mask::value>
>::type pfn_gen;
BOOST_MPL_ASSERT((is_same<pfn_gen, pG>));
// this one passes, should fail, though
BOOST_MPL_ASSERT((is_same<pfn_gen, pF>));
// I wish, but fails
//--------------------------------------------------------------------------------------------------
Thanks,
YuryK