Re: [Boost-bugs] [Boost C++ Libraries] #6131: #define foreach BOOST_FOREACH causes weird compile error in certain circumstances with boost 1.48

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #6131: #define foreach BOOST_FOREACH causes weird compile error in certain circumstances with boost 1.48
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2012-10-02 12:07:49


#6131: #define foreach BOOST_FOREACH causes weird compile error in certain
circumstances with boost 1.48
-------------------------------+--------------------------------------------
  Reporter: loonycyborg | Owner: eric_niebler
      Type: Bugs | Status: closed
 Milestone: To Be Determined | Component: foreach
   Version: Boost 1.50.0 | Severity: Problem
Resolution: fixed | Keywords:
-------------------------------+--------------------------------------------

Comment (by michel):

 The following treatment does not solve the problem, but it slightly
 improves the situation:

 In `boost/multi_index/hashed_index.hpp`, change
 {{{
 /* Boost.Foreach compatibility */

 template<
   typename KeyFromValue,typename Hash,typename Pred,
   typename SuperMeta,typename TagList,typename Category
>
 inline boost::mpl::true_* boost_foreach_is_noncopyable(
   boost::multi_index::detail::hashed_index<
     KeyFromValue,Hash,Pred,SuperMeta,TagList,Category>*&,
   boost::foreach::tag)
 {
   return 0;
 }
 }}}
 into
 {{{
 #if !(!defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
 \
  || BOOST_WORKAROUND(BOOST_MSVC, >= 1310) && !defined(_PREFAST_)
 \
  || (BOOST_WORKAROUND(__GNUC__, == 4) && (__GNUC_MINOR__ <= 5) &&
 !defined(BOOST_INTEL) && \
 !defined(BOOST_CLANG)) \
  || (BOOST_WORKAROUND(__GNUC__, == 3) && (__GNUC_MINOR__ >= 4) &&
 !defined(BOOST_INTEL) && \
 !defined(BOOST_CLANG)))
 /* Boost.Foreach compatibility */

 template<
   typename KeyFromValue,typename Hash,typename Pred,
   typename SuperMeta,typename TagList,typename Category
>
 inline boost::mpl::true_* boost_foreach_is_noncopyable(
   boost::multi_index::detail::hashed_index<
     KeyFromValue,Hash,Pred,SuperMeta,TagList,Category>*&,
   boost::foreach::tag)
 {
   return 0;
 }

 #endif
 }}}
 and do the same thing for `boost/multi_index/ordered_index.hpp`,
 `boost/multi_index/random_access_index.hpp` and
 `boost/multi_index/sequenced_index.hpp`.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/6131#comment:17>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:10 UTC