Boost logo

Boost Users :

Subject: Re: [Boost-users] mpl: copy algorithm question
From: Hicham Mouline (hicham_at_[hidden])
Date: 2010-05-16 07:47:54


>From: boost-users-bounces_at_[hidden]
[mailto:boost-users-bounces_at_[hidden]] On Behalf Of Darren Garvey
>Sent: 16 May 2010 12:29
>To: boost-users_at_[hidden]
>Subject: Re: [Boost-users] mpl: copy algorithm question

>Hi Hicham,

>On 16 May 2010 12:02, Hicham Mouline <hicham_at_[hidden]> wrote:

>> template <std::size_t max_dim>
>> struct S {
>> typedef boost::mpl::range_c<std::size_t, 2u, max_dim> range_t;
>> typedef boost::mpl::vector_c<std::size_t> all_dims1_t;
>> typedef boost::mpl::copy< range_t, boost::mpl::back_inserter<all_dims1_t>
>> >::type all_dims_t;
>> };

>> The error is:
>> error: type 'boost::mpl::copy<...>' is not derived from type 'S<max_dim>'

>> Really strange?

> mpl::copy<>::type is dependent on max_dim, so you need a "typename" in
front of boost::mpl::copy.

> Cheers,
> Darren

Indeed, thank you.

Is there a simpler way for me to construct the mpl::vector than defining the
range then copying it into the vector?

regards,


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