Boost logo

Boost :

From: Dirk Gerrits (dirk_at_[hidden])
Date: 2003-01-08 12:23:35


Vladimir Prus wrote:
>
> David Abrahams wrote:
>
>> Vladimir Prus <ghost_at_[hidden]> writes:
>
>
>>> I'd prefer the latter variant, so that non-broken platforms use more
>>> natural
>>> syntax. Another question is whether we could use only the second
>>> version.
>>> Theoretically, if you call the second version on const string, then
>>> InputT
>>> should be deduced as "const string". You can then write a simple
>>> wrapper to
>>> select const_iterator or iterator.
>>>
>>> The only problem is, IIRC, borland drops "const" on template arguments
>>> sometimes, and that's not possible to fix. Also, the "simple wrapper"
>>> requires partial specialization. So, I'm not sure this approach is
>>> viable, either.
>>
>>
>>
>> There are mostly-transparent solutions. Something like:
>>
>> // find_first sequence const version
>> template< typename InputT, typename SearchT >
>> inline iterator_range< typename InputT::const_iterator >
>> find_first_impl( const InputT& Input, const SearchT& Search, 0 )
>> {
>> ...
>> }
>
>
> I'm guessing the last parameter should be "int"?

Shouldn't it be long? I think I saw overload pairs in some Boost header
(from Boost Python I believe) where one overload had a dummy int
parameter and one overload had a dummy long parameter.

I assumed it was to workaround the partial ordering bug but I'm not 100%
sure. But Dave's upcoming reply should clarify things. ;)

Dirk Gerrits


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