|
Boost : |
From: Steven Watanabe (steven_at_[hidden])
Date: 2007-03-20 13:47:44
AMDG
Sebastian Redl <sebastian.redl <at> getdesigned.at> writes:
>
> Ion Gaztañaga wrote:
> > I mean:
> >
> > template<class T, member_hook T::* P>
> > class value_traits;
> >
> > compiles fine, but I just want to have one template parameter
> >
> > template<member_hook T::* P>
> > class value_traits;
> >
> > This is a compilation error. Can C++ deduce both the parent class and
> > the pointer to member? I don't see any reason that should forbid this,
> > but I can find the right syntax.
> >
> There is none. There's no such thing as implicit template parameters.
> Each parameter must be explicitly specified.
It's possible but ugly using macros.
template<class MemberPointer, MemberPointer P>
class value_traits;
#define BOOST_INTRUSIVE_VALUE_TRAITS(member_pointer) \
value_traits<BOOST_TYPEOF(member_pointer),member_pointer>
member_hook_t::BOOST_INTRUSIVE_VALUE_TRAITS(&T::hook)
In Christ,
Steven Watanabe
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk