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-03-05 13:37:02


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

Comment (by anonymous):

 Replying to [comment:4 anonymous]:
> I use just this #define in my code and I have actually _started_ to get
 compiler error with boost 1.49 (Xcode 4.3, LLVM compiler 3.1):
>
> Redefinition of 'is_lightweight_proxy'
> Redefinition of 'is_noncopyable'
>
> And even more errors that say:
>
> No matching function for call to 'should_copy_impl'

 FWIW the error actually comes up when using BOOST_REVERSE_FOREACH (which I
 use alongside foreach):

 ../Game/Widgets.hpp:130:9: error: no matching function for call to
 'should_copy_impl'
         PASS_TOUCH(touchBegan)
         ^~~~~~~~~~~~~~~~~~~~~~
 ../Game/Widgets.hpp:124:17: note: expanded from macro 'PASS_TOUCH'
                 BOOST_REVERSE_FOREACH (const WidgetPtr& child, children) \
                 ^
 /usr/local/include/boost/foreach.hpp:1117:77: note: expanded from macro
 'BOOST_REVERSE_FOREACH'
     if (boost::foreach_detail_::auto_any_t BOOST_FOREACH_ID(_foreach_end)
 = BOOST_FOREACH_REND(COL)) {} else \
 ^
 /usr/local/include/boost/foreach.hpp:1051:9: note: expanded from macro
 'BOOST_FOREACH_REND'
       , BOOST_FOREACH_SHOULD_COPY(COL))
         ^
 /usr/local/include/boost/foreach.hpp:961:6: note: expanded from macro
 'BOOST_FOREACH_SHOULD_COPY'
     (boost::foreach_detail_::should_copy_impl(
 \
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

 So maybe this is actually another bug?

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/6131#comment:5>
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:09 UTC