Conversion policies
Daniel Wallin <[email protected]>
| Newsgroups | gmane.comp.lib.boost.langbinding |
|---|---|
| Message-ID | <[email protected]> |
Given a conversion policy which handles conversions
xxx -> C++, what should be passed to the converter
function so that it can deduce the type?
struct my_converter_policy
{
template<class T>
T convert(const param_type&, ...<T>);
^^^^^^ what goes here?
};
The simplest approach would be to just pass a
boost::type<T>, but this means partial ordering
won't work. Also, IIRC, trying to deduce T from
type<const T&> results in an ICE on VC6.5.
FWIW, in luabind, we handle this by decorating the
type:
T by_value<T>
T& by_reference<T>
const T& by_const_reference<T>
T* by_pointer<T>
const T* by_const_pointer<T>
---
Daniel Wallin
-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01