Boost logo

Boost :

Subject: Re: [boost] [algorithm] to_lower_copy / to_upper_copy with no output param assumes sequence to be same as input
From: Sebastian Karlsson (sairony_at_[hidden])
Date: 2011-06-28 07:43:10


2011/6/24 Olaf van der Spek <ml_at_[hidden]>:
> On Thu, Jun 23, 2011 at 9:47 PM, Sebastian Karlsson <sairony_at_[hidden]> wrote:
>> Seems to be easier than I anticipated, just add output type as a param
>> and slap it in as the return type for transform_range_copy, like so:
>>
>>                template<typename SequenceT, typename OutputT >
>>                inline SequenceT to_lower_copy(
>
> Shouldn't the return type be OutputT?
>
>>                        const SequenceT& Input,
>>                        const std::locale& Loc=std::locale())
>>                {
>>                        return ::boost::algorithm::detail::transform_range_copy< OutputT >(
>>                                Input,
>>                                ::boost::algorithm::detail::to_lowerF<
>>                                typename range_value<SequenceT>::type >(Loc));
>>                }
>>
>> Seems to work with the little testing I've been able to do so far.
>
> I'm not sure if C++ allows this, but SequenceT can be deduced while
> OutputT can not.
> Shouldn't OutputT therefore come first in the template list so that
> SequenceT can be deduced?
>
> Olaf
> _______________________________________________
> Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
>

You're correct on both accounts, I've fixed it and added a ticket to
trac where hopefully one of the maintainers can take a closer look:
https://svn.boost.org/trac/boost/ticket/5651 .

Kind regards,
Sebastian Karlsson


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk