Opened 15 years ago

Closed 14 years ago

#1722 closed Bugs (fixed)

[TR1/Fusion] Conflict between TR1 and Fusion headers

Reported by: Richard Webb <Richard.Webb@…> Owned by: Joel de Guzman
Milestone: Boost 1.36.0 Component: fusion
Version: Boost Development Trunk Severity: Problem
Keywords: Cc:

Description

Originally posted @ http://article.gmane.org/gmane.comp.lib.boost.devel/171545 - opening it here so that it doesn't get forgotten. (I'm not sure if this should be assigned to TR1 or Fusion - assigning it to Fusion for now).

Hi,
I've got a project that uses Boost.TR1 (by adding boost/tr1/tr1 to my include
path) and Fusion, and i've run into some errors when including the Fusion
headers.
For example:

boost/fusion/tuple/make_tuple.hpp(21) : error C2027: use of undefined type
'boost::fusion::tuple<>'

boost/fusion/iterator/prior.hpp(50) : error C2039: 'tag_of' : is not a member
of 'boost::fusion::detail'

This seems to be caused by the inclusion of <utility> in
<boost/fusion/support/tag_of.hpp>, which when using Boost.TR1 like this causes
the Fusion headers to be included again. At the point when <utility> is
included, the tag_of include guard has been defined but tag_of itself hasn't
been declared, so nested inclusions of tag_of.hpp do nothing and the build
fails.

My code builds ok if i either:
-Include <utility> myself before Fusion
-Remove the include <utility> from tag_of.hpp (it doesnt actually seem to be
required - at least, the regression tests all pass with it removed)

This seems a bit fragile though. Is there a better way it can be fixed?

Change History (1)

comment:1 by John Maddock, 14 years ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.