Opened 11 years ago

Closed 10 years ago

#5627 closed Bugs (duplicate)

Compilation error when including range/algorithm.hpp before range/join.hpp

Reported by: Nicolas Savoire <nicos@…> Owned by: Neil Groves
Milestone: To Be Determined Component: range
Version: Boost 1.47.0 Severity: Regression
Keywords: Cc:

Description

The following code fails to compile (tested with gcc 4.5.2):

#include <boost/range/algorithm/search_n.hpp>
#include <boost/range/join.hpp>

int main() {}

with the error:

/usr/local/mkt-dev/src/boost/boost/range/join.hpp:44: error: expected template-name before ‘<’ token
/usr/local/mkt-dev/src/boost/boost/range/join.hpp:44: error: expected ‘{’ before ‘<’ token
/usr/local/mkt-dev/src/boost/boost/range/join.hpp:44: error: expected unqualified-id before ‘<’ token

It seems that the issue is that there is a boost::range::range_detail namespace in search_n.hpp and a boost::range_detail namespace in other files included, which confuses the compiler.

Change History (8)

comment:1 by Nicolas Savoire <nicos@…>, 11 years ago

Version: Boost Release BranchBoost 1.47.0

Any chance for this issue to be fixed for boost 1.47.0 ?

comment:2 by Dmitriy <boost@…>, 11 years ago

Is there a workaround by any chance? (Until it's actually fixed in a release.)

comment:3 by anonymous, 11 years ago

also see #6110 and #6103

comment:4 by Neil Groves, 11 years ago

Status: newassigned

comment:5 by anonymous, 10 years ago

Any work around?

comment:6 by anonymous, 10 years ago

With the fix being trivial I'm a little suprised that is problem still exists in boost 1.51.

The workaround is to include boost/range/join.hpp before any includes of boost/range/algorigthm..., but that is quite cumbersome.

comment:7 by Nathan Ridge, 10 years ago

Duplicate of #6103 (which was just fixed).

comment:8 by Nathan Ridge, 10 years ago

Resolution: duplicate
Status: assignedclosed
Note: See TracTickets for help on using tickets.