Boost logo

Boost Users :

Subject: [Boost-users] [multi-index] foreach supports breaks compilation
From: Szymon Gatner (szymon.gatner_at_[hidden])
Date: 2011-11-16 05:40:35


Hi,

I realize this is not really a multi-index bug but after I updated
from 1.47 to 1.48
my code no longer compiles due to this code:

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

with error:

Error 1 error C3083: 'BOOST_FOREACH': the symbol to the left of a '::'
must be a type c:\devel\boost_1_48_0\boost\multi_index\sequenced_index.hpp 926
Error 2 error C2039: 'tag' : is not a member of
'boost' c:\devel\boost_1_48_0\boost\multi_index\sequenced_index.hpp 926
Error 3 error C2061: syntax error : identifier
'tag' c:\devel\boost_1_48_0\boost\multi_index\sequenced_index.hpp 926

(similar errors for other indices)

this happens because as suggested in boost.foreach docs I have this earlier:

#define foreach BOOST_FOREACH

which (if I understand correctly) causes offending line to expand into:

boost::BOOST_FOREACH::tag

Is there anything easy I could do to fix this?

btw, 1.47 version has no explicit section marked as

/* Boost.Foreach compatibility */

yet I used BOOST_FOREACH macro on many indices all over the place.

Regards,
Simon


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