|
Boost : |
Subject: Re: [boost] [review] string convert
From: Vladimir Batov (vbatov_at_[hidden])
Date: 2011-05-03 04:49:46
> Vicente BOTET <vicente.botet <at> wanadoo.fr> writes:
>
> Vladimir, as you know I started Boos.Conversion as a more generic response to
> type-to-type conversion.
> ...
> I think the way Boost.Conversion is designed allows such overloading. It use a
> dummy parameter taking the type of the return type.
>
> template
> typename boost::enable_if, TypeOut>::type
> convert_to(const StringIn& from, boost::dummy::type_tag const&);
>
> template
> bool
> convert_to(const StringIn& from, boost::dummy::type_tag const&);
>
> The library provides a convert_to function that adds the specific dummy
parameter. I recognize this is
> tricky and that the overloading seems not natural from the user perspective
but it works at least for the
> cases I have tested.
Vicente, Gordon,
Thank you for the pointer, I had a quick look and indeed it seems to solve the
specialization problem I was facing. Should we cancel/postpone this review and
review Vicente's and mine together or something of that sort? If Vicente's is
better as a starting point, it's fine by me. I am happy either way a s long as
things are moving.
V.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk