Re: Re: [C++-sig] [Implementation] Calling wrapped functions, converters, policies
Daniel Wallin <[email protected]>
| Newsgroups | gmane.comp.lib.boost.langbinding |
|---|---|
| Message-ID | <[email protected]> |
At 22:51 2003-09-24, David Abrahams wrote: >Daniel Wallin <[email protected]> writes: > > > At 12:35 2003-09-23, David Abrahams wrote: > >>Daniel Wallin <[email protected]> writes: > >> > >> > At 14:46 2003-09-22, David Abrahams wrote: > >> >>Daniel Wallin <[email protected]> writes: > >> >> > >> >> > At 18:53 2003-09-21, David Abrahams wrote: > >> >> >>Daniel Wallin <[email protected]> writes: > >> >> >> > >> >> >> >>Actually I was thinking that the index should be encoded in > the type > >> >> >> >>of the converter. > >> >> >> > > >> >> >> > Ok, both approaches work. > >> >> >> > >> >> >>I think we may have single converter tuple at this point. If so > we'll > >> >> >>want something like: > >> >> >> > >> >> >> converters.convert(argument_package,mpl::int_<1>()); > >> >> > > >> >> > I have expressed some concern on this before due to the issue with an > >> >> > additional layer when returning temporaries from convert(). > >> >> > (with const& argument types..) > >> >> > > >> >> > I would rather see something like: > >> >> > > >> >> > get<0>(converters).convert(argument_package); > >> >> > > >> >> > or > >> >> > > >> >> > get<0>(converters).convert(argument_package, mpl::int_<0>()); > >> >> > >> >>I'm sorry, I don't see why one should be more problematic than the > >> >>other, but I'm willing to go with your first alternative if you like. > >> >>I think the 2nd one is unneccessary. > >> > > >> > It's problematic because of how the 'converters tuple' type would be > >> > implemented. I guess it could be implemented with inheritance, > >> > and require that converters take an mpl::int_<N> where N is their > >> > index. > >> > >>Name hiding could cause a problem there... unless... we could have a > >>using declaration built into the components to get around that. > > > > Right. > > > > template<class Base, class T> > > struct tuple_elem > > : Base, T > > { > > using Base::f; > > using T::f; > > }; > > > > struct empty_type > > { > > void f(); > > }; > > > > typedef inherit_linearly< > > sequence_t > > , tuple_elem<_,_> > > , empty_type>::type composite_t; > > > > Would work I guess. But that puts some additional requirement on the > > convert() signature.. > >You mean just matching the argument index? Big deal(?) No, not a big deal. But we should care about every additional requirement on the interface.. This does seem like a nice way to do things though. --- Daniel Wallin ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf