Boost logo

Boost Users :

Subject: Re: [Boost-users] Applying mpl::transform to an mpl::string
From: Eric Niebler (eric_at_[hidden])
Date: 2010-06-16 14:01:01


Hi Pedro,

On 6/10/2010 1:02 PM, Pedro d'Aquino wrote:
> Hi,
>
> I'm trying to apply a transformation to an mpl::string, but can't get it to
> compile. I'm using MS VC++2010 and Boost 1.43.0. The code:
>
> #include <boost/mpl/string.hpp>
> #include <boost/mpl/vector_c.hpp>
> #include <boost/mpl/transform.hpp>
> #include <boost/mpl/plus.hpp>
> #include <boost/mpl/arithmetic.hpp>
>
> using namespace boost;
>
> int main() {
>
> // this compiles OK
> typedef mpl::vector_c<int, 'abcd', 'efgh'> numbers;
> typedef mpl::transform<numbers, mpl::plus<mpl::_1, mpl::int_<1> > >::type result_numbers;
>
>
> // this doesn't (error C2039: 'value' : is not a member of 'boost::mpl::has_push_back_arg')
> typedef mpl::string<'abcd', 'efgh'> chars;
> typedef mpl::transform<chars, mpl::plus<mpl::_1, mpl::int_<1> > >::type result_chars;
>
> }
>
> I've posted the full error message at http://paste.ubuntu.com/447759/.
>
> Am I doing something wrong?

Thanks for the report. This is fixed now on trunk. It should make it
into the next release.

-- 
Eric Niebler
BoostPro Computing
http://www.boostpro.com

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