Boost logo

Boost :

Subject: Re: [boost] Range_Ex and Multi-Index: conflicting mpl::begin andboost::begin
From: Sandeep Gupta (gupta.sandeep_at_[hidden])
Date: 2009-03-18 14:37:55


On Wed, Mar 18, 2009 at 11:02 AM, vicente.botet
<vicente.botet_at_[hidden]> wrote:
> Hi Sandeep,
>
> I think your problem comes from the fact that you should have some using namespace declarations.
>    using namespace boost;
>    using namespace boost::mpl;
>
> If this is the case, try removing them and been explicit about which begin do you want; i.e. moost::begin or boost::mpl::begin.
>
> If this is not the case, I have no idead without a complete example and the result of the compilation.
>
> Best,
> Vicente
>

Thanks for looking into this Vicente. I am not directly adding
boost::mpl to the namespace. Please find attached the code. Below is
the full error.

home/sandeep/Computing/boost_1_38_0/boost/mpl/begin_end_fwd.hpp: In
function ‘typename boost::range_result_iterator<C>::type
boost::range_ex_detail::adl_begin(Rng&) [with Rng =
boost::multi_index::multi_index_container<std::pair<int, int>,
boost::multi_index::indexed_by<boost::multi_index::ordered_unique<boost::multi_index::member<std::pair<int,
int>, int, &std::pair<int, int>::first>, mpl_::na, mpl_::na>,
boost::multi_index::ordered_unique<boost::multi_index::member<std::pair<int,
int>, int, &std::pair<int, int>::second>, mpl_::na, mpl_::na>,
mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na,
mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na,
mpl_::na, mpl_::na, mpl_::na, mpl_::na>, std::allocator<std::pair<int,
int> > >]’:
/home/sandeep/Computing/boost_1_38_0/boost/range_ex/algorithm.hpp:79:
 instantiated from ‘Fun boost::for_each(Rng&, Fun) [with Rng = mic,
Fun = void (*)(const std::pair<int, int>&)]’
MultiIndexAndRangeEx.cpp:49: instantiated from here
/home/sandeep/Computing/boost_1_38_0/boost/mpl/begin_end_fwd.hpp:22:
error: ‘template<class Sequence> struct boost::mpl::begin’ is not a
function,
/home/sandeep/Computing/boost_1_38_0/boost/range/begin.hpp:96: error:
 conflict with ‘template<class T> typename boost::range_iterator::type
boost::begin(T&)’
/home/sandeep/Computing/boost_1_38_0/boost/range_ex/./detail/adl_begin_end.hpp:27:
error: in call to ‘begin’
/home/sandeep/Computing/boost_1_38_0/boost/mpl/begin_end_fwd.hpp: In
function ‘typename boost::range_result_iterator<C>::type
boost::range_ex_detail::adl_end(Rng&) [with Rng =
boost::multi_index::multi_index_container<std::pair<int, int>,
boost::multi_index::indexed_by<boost::multi_index::ordered_unique<boost::multi_index::member<std::pair<int,
int>, int, &std::pair<int, int>::first>, mpl_::na, mpl_::na>,
boost::multi_index::ordered_unique<boost::multi_index::member<std::pair<int,
int>, int, &std::pair<int, int>::second>, mpl_::na, mpl_::na>,
mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na,
mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na,
mpl_::na, mpl_::na, mpl_::na, mpl_::na>, std::allocator<std::pair<int,
int> > >]’:
/home/sandeep/Computing/boost_1_38_0/boost/range_ex/algorithm.hpp:79:
 instantiated from ‘Fun boost::for_each(Rng&, Fun) [with Rng = mic,
Fun = void (*)(const std::pair<int, int>&)]’
MultiIndexAndRangeEx.cpp:49: instantiated from here
/home/sandeep/Computing/boost_1_38_0/boost/mpl/begin_end_fwd.hpp:23:
error: ‘template<class Sequence> struct boost::mpl::end’ is not a
function,
/home/sandeep/Computing/boost_1_38_0/boost/range/end.hpp:92: error:
conflict with ‘template<class T> typename boost::range_iterator::type
boost::end(T&)’
/home/sandeep/Computing/boost_1_38_0/boost/range_ex/./detail/adl_begin_end.hpp:35:
error: in call to ‘end’

> ----- Original Message -----
> From: "Sandeep Gupta" <gupta.sandeep_at_[hidden]>
> To: <boost-users_at_[hidden]>; <boost_at_[hidden]>
> Sent: Wednesday, March 18, 2009 6:38 PM
> Subject: [boost] Range_Ex and Multi-Index: conflicting mpl::begin andboost::begin
>
>
>
> Hi,
>  I am under-impression that  for_each construct of range_ex  for all
> container concepts. However when I tried with multi-index it gave
> conflicting errors. Attached below is the code and corresponding
> errors.
>
> code:
>
> typedef multi_index_container<
>     std::pair<value_type,int>,
>     indexed_by<
>     ordered_unique<member<pair<value_type,int>, value_type,
> &pair<value_type, int>::first> >,
>     ordered_unique<member<pair<value_type,int>, int,
> &pair<value_type, int>::second> >
>     >
>     > mic;
>
> mic serialStore;
>  for_each(serialStore, std::cout<<boost::lambda::_1<<' ');
>
> error:
> /home/sandeep/Computing/boost_1_38_0/boost/mpl/begin_end_fwd.hpp:22:
> error: ‘template<class Sequence> struct boost::mpl::begin’ is not a
> function,
> /home/sandeep/Computing/boost_1_38_0/boost/range/begin.hpp:96: error:
>  conflict with ‘template<class T> typename boost::range_iterator::type
> boost::begin(T&)’
> /home/sandeep/Computing/boost_1_38_0/boost/range_ex/./detail/adl_begin_end.hpp:27:
> error:   in call to ‘begin’
>
> /home/sandeep/Computing/boost_1_38_0/boost/mpl/begin_end_fwd.hpp:23:
> error: ‘template<class Sequence> struct boost::mpl::end’ is not a
> function,
> /home/sandeep/Computing/boost_1_38_0/boost/range/end.hpp:92: error:
> conflict with ‘template<class T> typename boost::range_iterator::type
> boost::end(T&)’
> /home/sandeep/Computing/boost_1_38_0/boost/range_ex/./detail/adl_begin_end.hpp:35:
> error:   in call to ‘end’
>
>
> I apologies in advance if this is due to trivial omission.
>
> Thanks
> -sandeep
> _______________________________________________
> Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
>
>
> _______________________________________________
> Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
>




Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk