Boost logo

Boost :

From: Thorsten Ottosen (nesotto_at_[hidden])
Date: 2003-10-23 08:28:38


This is just a small remark regarding the string library and the use of
container argument algortihms.

Take a look at this function:

template<typename InputContainerT, typename SearchContainerT>
    iterator_range< typename string_algo::container_result_iterator<
InputContainerT >::type >
    find_first(InputContainerT &, const SearchContainerT &);

There is no overload for a constant first argument, so we can't use an
rvalue as the first argument even though
the algorithm does not mutate the argument.

I would say we have to provide

template<typename InputContainerT, typename SearchContainerT>
    iterator_range< typename string_algo::container_const_iterator<
InputContainerT >::type >
    find_first(const InputContainerT &, const SearchContainerT &);

too for all similar algorithms. I know this will break the implementation on
compilers without ordering of function templates, but
then the implementation should fall back on the current one. Did I overlook
something?

regards

Thorsten


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