Boost logo

Boost Users :

Subject: Re: [Boost-users] boost::any_range with an abstract class reference
From: Michel Morin (mimomorin_at_[hidden])
Date: 2013-08-23 14:55:04


Hi,

voivoid wrote:
> Compilation fails with the following error ( looks like
> any_range value is supposed to be copy-constructable? )
> Is there any workaround?

I don't know the details of any_range, but here is a hack:

Change Line 49-51 of <boost/range/detail/any_iterator_interface.hpp>

    typedef typename remove_const<
        typename remove_reference<Reference>::type
>::type reference_as_value_type;

to

    typedef typename mpl::if_<
        mpl::or_<
            is_abstract<typename remove_reference<Reference>::type>
          , is_array<typename remove_reference<Reference>::type>
>
      , Reference
      , typename remove_const<
            typename remove_reference<Reference>::type
>::type
>::type reference_as_value_type;

Regards,
Michel

P.S.
When you post a thread to Boost mailing list, please include
the library name (in the bracket) at the beginning of the subject.
(e.g. [range] any_range with an abstract class reference)
This will draw more attention to the post.


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