Boost logo

Boost Users :

Subject: Re: [Boost-users] [container] Initialization from transformed_range compilation error
From: Szymon Gatner (szymon.gatner_at_[hidden])
Date: 2011-09-04 17:08:00


2011/9/4 Ion Gaztañaga <igaztanaga_at_[hidden]>:
> El 04/09/2011 12:12, Szymon Gatner escribió:
>>
>> Hi,
>>
>> snipped below gives this error in VS 2008 SP1:
>>
>> Error   1       error C2664: 'void
>> boost::container::vector<T>::priv_range_insert<InIt>(Object
>> **,FwdIt,FwdIt,std::forward_iterator_tag)' : cannot convert parameter
>> 4 from
>> 'boost::detail::iterator_category_with_traversal<Category,Traversal>'
>> to 'std::forward_iterator_tag'
>>  c:\devel\boost_1_47_0\boost\container\vector.hpp        1908    copy_range
>
> AFAIK, Boost.Range does not support Boost.Container.
>

It is not something that Boost.Range should support explicitly imho as
there is no
problem with exact same code with std::vector instead of
boost::container::vector.

This is what copy_range does:

        template< typename SeqT, typename Range >
        inline SeqT copy_range( const Range& r )
        {
            return SeqT( boost::begin( r ), boost::end( r ) );
        }

Code I attached just tries to initialize boost::container::vector from
2 iterators. (Same
error when using explicit assign() method). Also copying transformed_range to a
container::vector is OK, only (re) initialization fails.

Regards,
Simon

-- 
Szymon Gatner
The Lordz Games Studio
www.thelordzgamesstudio.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