Opened 8 years ago

Closed 8 years ago

#3000 closed Bugs (fixed)

Boost.foreach header conflicts with Python headers

Reported by: Alexander Stukowski <alexstu@…> Owned by: eric_niebler
Milestone: Boost 1.39.0 Component: foreach
Version: Boost Development Trunk Severity: Problem
Keywords: Cc:


When using the Python and Boost.Python headers in a program before including the Boost.foreach header, I get a weired compiler error in line 221 of boost/foreach.hpp.

This is probably because the Python headers #define the word "Bool" used in that line.

Changing the code in line 221 and 222 of foreach.hpp to

template<typename Bool1>

inline boost::mpl::not_<Bool1> *not_(Bool1 *) { return 0; }

avoids the problem.

I used GCC 4.3.2 on Ubuntu Linux; Python 2.5 and Python 2.6.

Attachments (0)

Change History (1)

comment:1 Changed 8 years ago by eric_niebler

  • Resolution set to fixed
  • Status changed from new to closed

(In [52836]) work around conflict with python headers, fixes #3000

Add Comment

Modify Ticket

Change Properties
Set your email in Preferences
as closed The owner will remain eric_niebler.
The resolution will be deleted. Next status will be 'reopened'.

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.