Boost logo

Boost Users :

From: Pavel Vozenilek (pavel_vozenilek_at_[hidden])
Date: 2005-06-06 19:36:03


"Pavol Droba" wrote:

>> It definitely seems as a compiler related problem.
>
BCB has many quirks.

> I have commited a fix for trim and case conversion. Can you please verify
> if it
> helped?
>
No the bug was the same.

Following changes are needed in the code:

a) leading :: before namespace:

   ::boost::algorithm::detail::trim_begin(
should be
   boost::algorithm::detail::trim_begin(

everywhere (BCB doesn't like it).

b) the begin() and end() needs to be fully qualified for BCB:

                boost::algorithm::detail::trim_end(
                    boost::begin(Input), <<== here
                    boost::end(Input), <<== here
                    IsSpace ),

on both places where compiler complains.

c) The iterator needs to be explicitly declared.

I rewrote it into:

        template<typename SequenceT, typename PredicateT>
        inline void trim_right_if(SequenceT& Input, PredicateT IsSpace)
        {
            SequenceT::iterator it =
boost::algorithm::detail::trim_end(boost::begin(Input), boost::end(Input),
IsSpace);
            Input.erase(it, boost::end(Input));
        }

and

        template<typename SequenceT, typename PredicateT>
        inline void trim_left_if(SequenceT& Input, PredicateT IsSpace)
        {
            SequenceT::iterator it =
boost::algorithm::detail::trim_begin(boost::begin(Input), boost::end(Input),
IsSpace);
            Input.erase(boost::begin(Input), it);

        }

and then it compiles (with your latest CVS version).

/Pavel


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net